I try to test this async method:
public static async Task SimpleAsync() { await Task.Delay(10); throw new Exception("Should fail."); } with:
Assert.Throws<Exception>(async () => await AsyncUnderTest.SimpleAsync()); but NUnit doesn't run:
Async void methods are not supported
How should I test the exception in NUnit?
I wonder how to include the Task return value in the lambda expression?
This question is much clearer and educational then the chaotic so-called "duplicate" question.
Assert.ThrowsAsync..