private bool AuthorizationReversalsAreEquivalent(AuthorizationReversal rev1, AuthorizationReversal rev2) { if (!rev1.Id().Equals(rev2.Id()) || !rev1.MerchantRefNum().Equals(rev2.MerchantRefNum()) || !rev1.TxnTime().Equals(rev2.TxnTime()) || !rev1.Amount().Equals(rev2.Amount()) || !rev1.Status().Equals(rev2.Status())) { return(false); } return(true); }
public async Task When_I_lookup_a_reversal_using_a_reversal_id_Then_it_should_return_a_valid_reversal_async() { _auth = await _cardService.AuthorizeAsync(_auth); AuthorizationReversal authReversal = AuthorizationReversal.Builder() .MerchantRefNum(_auth.MerchantRefNum()) .Amount(6666) .AuthorizationId(_auth.Id()) .Build(); authReversal = await _cardService.ReverseAuthAsync(authReversal); AuthorizationReversal returnedReversal = await _cardService.GetAsync(new AuthorizationReversal(authReversal.Id())); Assert.That(returnedReversal.Status(), Is.EqualTo("COMPLETED")); Assert.That(AuthorizationReversalsAreEquivalent(authReversal, returnedReversal)); }