C# NUnit assert ThrowsAsync code example
Example: nunit using async method with throws
[Test]
public void Tests()
{
// Using a method as a delegate
Assert.ThrowsAsync<ArgumentException>(async () => await MethodThatThrows());
}
[Test]
public void Tests()
{
// Using a method as a delegate
Assert.ThrowsAsync<ArgumentException>(async () => await MethodThatThrows());
}