Reputation: 512
Can I finish the unit test from code? Is it possible to do something like this?
[Fact]
public void Test()
{
code;
code;
code;
StopUnitTest(success: true);
code;
code;
}
Upvotes: 0
Views: 1626
Reputation: 2988
Not really sure why one would do that and I know it's maybe a bit too late to reply. However, the usage of goto
keyword could potentially solve this.
Reference: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/goto
Upvotes: 2