public void FailedPayment(PaymentScheme paymentScheme, PaymentScheme allowedPaymentSchemes, decimal balance, AccountStatus accountStatus) { var payment = new TestPaymentService(); payment.Account.AllowedPaymentSchemes = allowedPaymentSchemes; payment.Account.Balance = balance; payment.Account.Status = accountStatus; var request = CreateStandardRequest(paymentScheme); Assert.IsFalse(payment.MakePayment(request).Success); }
[TestCase(20, 50, 20)] // I don't have enough money to take 50 from 20, so it should remain 20. public void TakesPaymentCorrectly(decimal startAmmount, decimal paymentAmount, decimal endAmmount) { var payment = new TestPaymentService(); payment.Account.AllowedPaymentSchemes = PaymentScheme.Bacs | PaymentScheme.FasterPayments | PaymentScheme.Chaps; payment.Account.Balance = startAmmount; var request = CreateStandardRequest(PaymentScheme.FasterPayments); request.Amount = paymentAmount; payment.MakePayment(request); Assert.AreEqual(payment.Account.Balance, endAmmount); }