What is the xUnit equivalent of the following MSTest code:
Assert.Inconclusive("Reason");
This gives a yellow test result instead of the usual green or red. I want to assert that the test could not be run due to certain conditions and that the test should be re-run after those conditions have been met.
One way is to use the
Skip
parameter within theFact
orTheory
attributes.Which gives this result when run:
I normally do something like this,
throw new Exception("Inconclusive");
yes it shows as a failed test, but at least you can raise this in the test under certain inconclusive cases.
I've not used the skippablefact feature mentioned above, but that sounds like a great solution to me.
Best thing one can do until something is implemented in the library is to use Xunit.SkippableFact
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