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

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?