Created
July 9, 2015 19:50
-
-
Save angelovstanton/7b67f21022c3bc0f792e 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 OwnerTestBehaviorObserver : BaseTestBehaviorObserver | |
{ | |
public OwnerTestBehaviorObserver(ITestExecutionSubject testExecutionSubject) | |
: base(testExecutionSubject) | |
{ | |
} | |
public override void PreTestInit(TestContext context, MemberInfo memberInfo) | |
{ | |
this.ThrowExceptionIfOwnerAttributeNotSet(memberInfo); | |
} | |
private void ThrowExceptionIfOwnerAttributeNotSet(MemberInfo memberInfo) | |
{ | |
try | |
{ | |
var ownerAttribute = memberInfo.GetCustomAttribute<OwnerAttribute>(true); | |
} | |
catch | |
{ | |
throw new Exception("You have to set Owner of your test before you run it"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment