Skip to content

Instantly share code, notes, and snippets.

@jmarmolejos
Created October 16, 2016 17:22
Show Gist options
  • Save jmarmolejos/a879772eaa0c0bcfc7ee8dea020d1877 to your computer and use it in GitHub Desktop.
Save jmarmolejos/a879772eaa0c0bcfc7ee8dea020d1877 to your computer and use it in GitHub Desktop.
[TestMethod]
[ExpectedException(typeof(HttpRequestException))]
public async Task Should_raise_exception()
{
var httpClient = new HttpClient(new ExceptionRaisingHandler());
var requestBinClient = new RequestBinClient(httpClient);
await requestBinClient.PostStuff(new {foo = "bar"});
Assert.Fail("Should not reach this part.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment