xUnit Equivalent of MSTest’s Assert.Inconclusive

Best thing one can do until something is implemented in the library is to use Xunit.SkippableFact:

[SkippableFact]
public void SomeTest()
{
    var canRunTest = CheckSomething();
    Skip.IfNot(canRunTest);

    // Normal test code
}

This will at least make it show up as a yellow ignored test case in the list.

Credit goes to https://stackoverflow.com/a/35871507/537842

Leave a Comment