I am trying to write a unit test to make sure the results of a method are correct based on different values of a static variable.
Here is a simple example:
public void TestMethod1()
{
Object1.StaticMember = 1
Object2 test = new Object2();
Assert.AreEqual("1", test.getStaticVal());
}
public void TestMethod2()
{
Object1.StaticMember = 2
Object2 test = new Object2();
Assert.AreEqual("2", test.getStaticVal());
}
I was informed that unit tests in VS2012 are excecuted concurrently so there is a posibility of the tests failing. Is this true? How can I write the tests to run one at a time?