Hi, I am trying to Unit Test the application using VSTS 2008 unit Testing. My Problem is: I want to invoke two test case in an order. I am using the ordered Test case feature of VSTS 2008 for this. Problem i facing is I increment the value of one variable(X) in TestA and on the basis of that value i am chekcing something in TestB. But when the control comes into TestB, I get the initial value of the X but not that which was incremented in TestA. I think for every test vsts create a new instance of the test class in memory. Please suggest a solution to this except use of STATIC variables.
Code for the same is as below
[TestMethod()]
public void ff()
{
i = 11;
}
[TestMethod()]
public void gg()
{
if (i == 4)
{
System.Diagnostics.Debug.WriteLine("it is 4");
}
else
{
System.Diagnostics.Debug.WriteLine("it is 7");
}
}
Thanks in Advance