0

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?

Christian
  • 1,022
  • 13
  • 28
  • Check here https://stackoverflow.com/questions/709331/switching-between-using-nunit-and-mstest-for-unit-testing – MichaelMao Jan 10 '23 at 12:50

0 Answers0