Skip to content

Instantly share code, notes, and snippets.

@makomweb
Created July 14, 2017 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makomweb/2006d3e1aec41cf2085d9e2835f545cb to your computer and use it in GitHub Desktop.
Save makomweb/2006d3e1aec41cf2085d9e2835f545cb to your computer and use it in GitHub Desktop.
When awaiting null it should throw
[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