c# - Unit Tests fail when run together, pass individually -


So I'm having some problems with my unit test, I can not copy it and olden them here but what I I'll give it.

The problem is that if I run examinations, everything works with purpose, but if I ask it to run all the tests then 1/5 will pass,

  [TestMethod] Public Zero ObjTest () {// Arrange - Multiple Ecommerce and Items var t = new var (); T.itemNumbers = new list & lt; Item number & gt; (); Obj e = new obj (); E.property = "(12345 or 55555) and! 65232"; Globals.masterList.Add (e); Item number I = new item number (); I.num = "12345"; Item number i1 = new item number (); I1.num = "55555"; Item number I2 = new item number (); I2.num = "55556"; T.itemNumbers.Add (i); T.itemNumbers.Add (i1); T.itemNumbers.Add (i2); ICollection & LT; Iinterface & gt; Tmp = new list & lt; Iinterface & gt; (); // Act, process of ecu and item lists; Functions call (T. volume number, global. Master list, riff tmp); // to emphasize, only 2 in the list should be added. Assurance Airequal (1, tmp.cn, ""); Assurance.Arequal ("(12345 or 55555) and! 65232", call the function (T. volume number, globals. Master list, ref TMP), "wrong obie's returned."); }  

All of the unit tests are basically a copy and past e. The property is with chages and possibly changes to one of the i numbers,

The test is designed to examine cases of increment based on user input.

Is there anything that is to ensure that the scope is emphasizing all the variables and all the tests or serial execution.

I Globals.masterList.Add (e); Suppose your threshold is run in five units. This means that globals.master list.ed (e); will be executed five times or the masterlist will be modified by five separate threads. After this you have the next line of code:

  assurance. Airequal ("(12345 or 55555) and! 65232", function call (T. volume number, globals. Master list, ref tmp), "wrong oz returned.");  

Functions deals with the modified list by other functions, and as a result you have separate output from it and consequently failed unit test


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -