public void IsValid_NonPaymentFasterPaymentsSchemes_ReturnsFalse(AllowedPaymentSchemes paymentSchemes) { //Arrange _account.AllowedPaymentSchemes = paymentSchemes; //Act var isValid = _fasterPaymentsValidator.IsValid(_account, _makePaymentRequest); //Assert Assert.That(isValid, Is.False); }
public void IsValid_Should_Return_True_When_Account_Has_Sufficient_Funds() { var result = _fasterPaymentsValidator.IsValid( new MakePaymentRequest { Amount = 20 }, new Account { AllowedPaymentSchemes = AllowedPaymentSchemes.FasterPayments, Balance = 30 }); Assert.IsTrue(result); }
public void ShouldValidateSuccessfullyOnlyIfAccountExistsAndFasterPaymentsIsAllowedAndCustomerHasEnoughFunds() { //Act var result = _fasterPaymentsValidator.IsValid( new MakePaymentRequest { Amount = 20 }, new Account { AllowedPaymentSchemes = AllowedPaymentSchemes.FasterPayments, Balance = 30 }); //Assert Assert.IsTrue(result); }
public void FasterPaymentValidator_AccountHaveNoEnoughBalance_ReturnsInValid() { var fasterPayments = new FasterPaymentsValidator(); var account = new Account { AllowedPaymentSchemes = AllowedPaymentSchemes.FasterPayments, Balance = 1000 }; Assert.False(fasterPayments.IsValid(account, 1100)); }
public void FasterPaymentValidator_ValidAccount_ReturnsValid() { var fasterPayments = new FasterPaymentsValidator(); var account = new Account { AllowedPaymentSchemes = AllowedPaymentSchemes.FasterPayments, Balance = 1100 }; Assert.True(fasterPayments.IsValid(account, 1100)); }