Last active
August 29, 2015 14:24
-
-
Save angelovstanton/10b8cd83d44b1d610de1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MSTestExecutionProvider : IExecutionProvider | |
{ | |
public event EventHandler<TestExecutionEventArgs> TestInstantiatedEvent; | |
public event EventHandler<TestExecutionEventArgs> PreTestInitEvent; | |
public event EventHandler<TestExecutionEventArgs> PostTestInitEvent; | |
public event EventHandler<TestExecutionEventArgs> PreTestCleanupEvent; | |
public event EventHandler<TestExecutionEventArgs> PostTestCleanupEvent; | |
public void PreTestInit(TestContext context, MemberInfo memberInfo) | |
{ | |
this.RaiseTestEvent(this.PreTestInitEvent, context, memberInfo); | |
} | |
public void PostTestInit(TestContext context, MemberInfo memberInfo) | |
{ | |
this.RaiseTestEvent(this.PostTestInitEvent, context, memberInfo); | |
} | |
public void PreTestCleanup(TestContext context, MemberInfo memberInfo) | |
{ | |
this.RaiseTestEvent(this.PreTestCleanupEvent, context, memberInfo); | |
} | |
public void PostTestCleanup(TestContext context, MemberInfo memberInfo) | |
{ | |
this.RaiseTestEvent(this.PostTestCleanupEvent, context, memberInfo); | |
} | |
public void TestInstantiated(MemberInfo memberInfo) | |
{ | |
this.RaiseTestEvent(this.TestInstantiatedEvent, null, memberInfo); | |
} | |
private void RaiseTestEvent(EventHandler<TestExecutionEventArgs> eventHandler, TestContext testContext, MemberInfo memberInfo) | |
{ | |
if (eventHandler != null) | |
{ | |
eventHandler(this, new TestExecutionEventArgs(testContext, memberInfo)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment