Created
July 14, 2017 08:31
-
-
Save makomweb/2006d3e1aec41cf2085d9e2835f545cb to your computer and use it in GitHub Desktop.
When awaiting null it should throw
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
[Fact] | |
public async Task When_awaiting_null_it_should_throw() | |
{ | |
try | |
{ | |
Task t1 = Task.Run(() => { /* do nothing */ }); | |
Task t2 = null; | |
await Task.WhenAll(t1, t2); | |
Assert.True(false, "Should have thrown before!"); | |
} | |
catch (Exception ex) | |
{ | |
Assert.IsType<ArgumentException>(ex); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment