Created
January 20, 2013 11:50
-
-
Save simoneb/4578097 to your computer and use it in GitHub Desktop.
Async lambda support in NUnit framework
This file contains hidden or 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 AsyncLambaSupport() | |
{ | |
// throwing asynchronously | |
Assert.That(async () => await ThrowAsync(), Throws.TypeOf<InvalidOperationException>()); | |
// returning values asynchronously | |
Assert.That(async () => await ReturnOneAsync(), Is.EqualTo(1)); | |
// "After" works with async methods too | |
Assert.That(async () => await ResutnOneAsync(), Is.EqualTo(1).After(100)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment