public static void AssertSuccessfulPayment(JudoPayDotNet.Models.IResult<JudoPayDotNet.Models.ITransactionResult> result) { Assert.That(result, Is.Not.Null); Assert.That(result.HasError, Is.False); Assert.That(result.Response, Is.Not.Null); Assert.That(result.Response.Result, Is.EqualTo("Success"), "Expected 'Success', was '" + result.Response.Result + "'"); Assert.That(result.Response.ReceiptId > 0, Is.True); }
public static void AssertErrorResponseWithModelErrors(JudoPayDotNet.Models.IResult<JudoPayDotNet.Models.ITransactionResult> result, int numberOfModelErrorsExpected, int errorCode) { Assert.That(result, Is.Not.Null); Assert.That(result.HasError, Is.True); Assert.That(result.Response, Is.Null); Assert.That(result.Error, Is.Not.Null); Assert.That((result.Error.ModelErrors ?? new List<FieldError>()).Count, Is.EqualTo(numberOfModelErrorsExpected)); Assert.That(result.Error.Code, Is.EqualTo(errorCode)); }
public static void AssertDuplicatePayment(JudoPayDotNet.Models.IResult<JudoPayDotNet.Models.ITransactionResult> firstResult, JudoPayDotNet.Models.IResult<JudoPayDotNet.Models.ITransactionResult> secondResult) { Assert.That(firstResult, Is.Not.Null); Assert.That(firstResult.HasError, Is.False); Assert.That(firstResult.Response, Is.Not.Null); Assert.That(firstResult.Response.Result, Is.EqualTo("Success")); Assert.That(firstResult.Response.ReceiptId > 0, Is.True); Assert.That(secondResult, Is.Not.Null); Assert.That(secondResult.HasError, Is.False); Assert.That(secondResult.Response, Is.Not.Null); Assert.That(secondResult.Response.Result, Is.EqualTo("Success")); Assert.That(secondResult.Response.ReceiptId > 0, Is.True); Assert.That(firstResult.Response.ReceiptId == secondResult.Response.ReceiptId, Is.True); }