So I have situation when I need skip current test from test method body.
Simplest way is to write something like this in test method.
if (something) return;
But I have a lot complicated tests and I need a way to skip test from methods which I invoke in current test method body.
Is it possible?
Further to other answers (and as suggested): I’d suggest using
Assert.InconclusiveoverAssert.Fail, since the original poster’s situation is not an explicit failure case.Using
Inconclusiveas a result makes it clear that you don’t know whether the test succeeded or failed – which is an important distinction. Not proving success doesn’t always constitute failure!