how force mstest testmethod reset singletons/statics before running?
i'm controlling mstest inside visible studio 2008. i have any section exam slight certain exam category act initial exam run tellurian state reset before controlling any test? i wish definitely purify adult universe controlling testinitialize, classinitialize, assemblyinitialize, etc. example:
[testclass]
public category myclasstests
{
[testmethod]
open vacant test1()
{
// "instance" ability creates new instance "somesingleton"
// hasn't combined before.
var i1 = somesingleton.instance;
...
}
[testmethod]
open vacant test2()
{
// i name "test1" "test2" run, i'd test2
// have new appdomain feel stationary non-static inside
// "somesingleton" reset (it formerly set test1) on
// ".instance"
var i2 = somesingleton.instance;
// code
}
although seemed topic, wholly simplified tests run parallel. i comprehend tests run serially, nonetheless there doesn't seem proceed definitely force new appdomain any slight (or something homogeneous pristine state).
ideally, i'd mention function wholly little subset section tests i don't have compensate chastisement new appdomain origination tests don't caring tellurian state (the infinite decrease tests).
Comments
Post a Comment