Extend the ShouldThrow*() methods for Func<Task> too so you can work with async methods:
Func<Task> foo = async () => { await DoSthAsync(); }
foo.ShouldThrow<ArgumentNullException>();
Comments: Please neglect. Should use instead: Func<Task<HttpResponseMessage>> func = ... func.ShouldThrow<HttpResponseException>();
Func<Task> foo = async () => { await DoSthAsync(); }
foo.ShouldThrow<ArgumentNullException>();
Comments: Please neglect. Should use instead: Func<Task<HttpResponseMessage>> func = ... func.ShouldThrow<HttpResponseException>();