public void ParserExceptionsBubbleUp( HttpRequestMessage request, JSendParseException exception, [Frozen] IJSendParser parser, [Greedy, MockHttpClient] JSendClient client) { // Fixture setup Mock.Get(parser) .Setup(p => p.ParseAsync <object>(It.IsAny <JsonSerializerSettings>(), It.IsAny <HttpResponseMessage>())) .ThrowsAsync(exception); // Exercise system and verify outcome client .Awaiting(c => c.SendAsync <object>(request)) .ShouldThrow <JSendParseException>(); }
public void ParserExceptionsBubbleUp( HttpRequestMessage request, JSendParseException exception, [Frozen] IJSendParser parser, [Greedy, MockHttpClient] JSendClient client) { // Fixture setup Mock.Get(parser) .Setup(p => p.ParseAsync<object>(It.IsAny<JsonSerializerSettings>(), It.IsAny<HttpResponseMessage>())) .ThrowsAsync(exception); // Exercise system and verify outcome client .Awaiting(c => c.SendAsync<object>(request)) .ShouldThrow<JSendParseException>(); }