I have a need where i need to skip the test method based on certain bool condition in a class. is it possible? how can it be achieved? i have tried extending the FactAttribute but i cannot get the instance of the Test class.
my code below:
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
namespace XUnitTestProject1
{
public class MyTestClass
{
bool SomeCondition;
public MyTestClass()
{
SomeCondition = false;
}
[Fact] //I WANT TO SKIP THIS TEST AS SOMECONDITON == FALSE
void MyTestMethod()
{
}
}
}