I'm using MSTest (VS2008) and I need to persist a variable between tests. However the variable gets re-initialized between every test.
According to the third point mentioned in this answer,
MSTest always instantiates a new instance of the test class for each test method being executed.
Is there a straightforward way to keep the value of a variable between tests, or somehow suppress this behaviour?
Best Answer
Use a static member variable: