/// <summary> /// Verifies that the action of the method under test behaves as expected. /// </summary> /// <param name="actual">The output created by the method under test.</param> public virtual void Assert(TOutput actual) { actual.ShouldNotBeNull(); var response = GetSwiftResponse.GetResponse(actual); response.ShouldNotBeNull(); if (actual is GetSwiftException exception) { exception.HttpStatusCode.ShouldBe(HttpStatusCode.BadRequest); } else if (actual is Exception) { } else { response.StatusCode.ShouldBe(HttpStatusCode.OK); } }
/// <summary> /// Initializes a new instance of the <see cref="GetSwiftException"/> class with a specific error /// message, a reference to the inner exception that is the cause of this exception, and the response /// from the server. /// </summary> /// <param name="message">The error message that explains the reason for the exception.</param> /// <param name="innerException"> /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified. /// </param> /// <param name="response">The response from the server.</param> internal GetSwiftException(string message, Exception innerException, GetSwiftResponse response) : base(message, innerException) { Response = response; }