Code inspection: NUnit. Async test method must return Task or Task<T>

Last modified: 11 February 2024

Async test methods in NUnit 3.x must return either Task if no value is returned, or Task<T> if a value of type T is returned. Below are two situations where async tests will not be working correctly.

In both situations you need to rewrite test methods so that they return either Task or Task<T>.