When running our NUnit tests on the build server, some of them failed with the following error message:
Method has non-void return value
When I looked at the failed tests, they were all using the async/await syntax:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public async Task AsyncTest() | |
{ | |
await ... | |
} |
I found the following posts mentioning the error message:
- http://simoneb.github.io/blog/2013/01/19/async-support-in-nunit/
- http://anthonysteele.co.uk/async-and-await-with-nunit
The proposed solution was to updated NUnit to a more recent version, but when I took a look on the build server we were already using NUnit 2.6.
Anyone with an alternative solution?