public void DataThrowsException(JErrorResponse<int> response) { // Exercise system and verify outcome response.Invoking(r => { var x = r.Data; }) .ShouldThrow<JSendRequestException>() .WithMessage("JSend status does not indicate success: \"fail\"."); }
public void EnsureSuccessStatus_Throws_WhenStatusIsNotSuccess(JErrorResponse <int> response) { // Exercise system and verify outcome response.Invoking(rsp => rsp.EnsureSuccessStatus()) .ShouldThrow <JSendRequestException>() .WithMessage("JSend status does not indicate success: " + response + "."); }
public void DataThrowsException(JErrorResponse <int> response) { // Exercise system and verify outcome response.Invoking(r => { var x = r.Data; }) .ShouldThrow <JSendRequestException>() .WithMessage("JSend status does not indicate success*"); }
public void EnsureSuccessStatus_DisposesOfHttpResponseMessage_WhenStatusIsNotSuccess(JSendError error, HttpResponseMessageSpy spy) { // Fixture setup var response = new JErrorResponse <int>(error, spy); // Exercise system try { response.EnsureSuccessStatus(); } catch { } // Verify outcome spy.Disposed.Should().BeTrue(); }
public void StatusMatchesErrorStatus(JErrorResponse<int> response) { // Exercise system and verify outcome response.Status.Should().Be(response.Error.Status); }
public void DoesNotHaveData(JErrorResponse<int> response) { // Exercise system and verify outcome response.HasData.Should().BeFalse(); }
public void StatusMatchesErrorStatus(JErrorResponse <int> response) { // Exercise system and verify outcome response.Status.Should().Be(response.Error.Status); }
public void DoesNotHaveData(JErrorResponse <int> response) { // Exercise system and verify outcome response.HasData.Should().BeFalse(); }