I have a custom TestMethodAttribute in MSTest and want to build something similar in NUnit.
The Custom TestMethodAttribute in MSTest:
public class CustomTestMethod : TestMethodAttribute
{
public override TestResult[] Execute(ITestMethod testMethod)
{
if(SomeConditon){
var results = new[]
{
new TestResult
{
Outcome = UnitTestOutcome.Inconclusive,
TestContextMessages = "Test Skipped"
}
};
return results;
}
return base.Execute(testMethod);
}
}
I this possible in Nunit and yes how can I do this?