sharing state among testmethods mstest
how i share state among testmethods mstest. tests run systematic tests sequence.
private testcontext testcontext;
open testcontext testcontext
{
{ relapse this.testcontext; }
set { this.testcontext = value;}
}
[testmethod]
open vacant subscribe()
{
bool subscribed = true;
testcontext.properties.add("subscribed", subscribed);
assert.istrue(subscribed == true, string.format("subscribed...{0}", this.gethashcode()));
}
[testmethod]
open vacant generateevent()
{
bool subscribed = (bool)testcontext.properties["subscribed"];
assert.istrue(subscribed == true, string.format("subscribed...{0}", this.gethashcode()));
}
thanks advance.
Comments
Post a Comment