public async Task Post_returnsStatusInternalServerError_throwAnyOtherMessageException() { var exceptionType = typeof(TestMessageException); using var fixture = new MessagingClientFixtureBuilder() .AddWebHandler <TestFailMessageHandler>() .Create(); var response = await fixture.Request(new TestFailMessage(exceptionType.AssemblyQualifiedName)); response.Should().BeEquivalentTo(new { StatusCode = HttpStatusCode.InternalServerError }); var responseObject = await fixture.ReadObject <MessageException>(response); responseObject.Should().BeOfType <TestMessageException>(); }
public async Task Post_returnsStatusNotFound_thrownMessageNotRegisteredException() { var exceptionType = typeof(MessageNotRegisteredException); using var fixture = new MessagingClientFixtureBuilder() .AddWebHandler <TestFailMessageHandler>() .Create(); var response = await fixture.Request(new TestFailMessage(exceptionType.AssemblyQualifiedName)); response.Should().BeEquivalentTo(new { StatusCode = HttpStatusCode.NotFound }); var responseObject = await fixture.ReadObject <MessageException>(response); responseObject.Should().BeOfType <MessageNotRegisteredException>(); }