public void Initialize()
 {
     _accountSuitableRuleMock = new Mock <IAccountSuitableRule>();
     _accountSuitableRuleMock
     .Setup(x => x.IsAccountSuitable(It.IsAny <Account>(), It.IsAny <AllowedPaymentSchemes>()))
     .Returns(true);
     _paymentRule = new ChapsPaymentRule(_accountSuitableRuleMock.Object);
 }
 public WhenValidatingChapsPaymentWithNullAccount()
 {
     chapsPaymentRule   = new ChapsPaymentRule();
     makePaymentRequest = new PaymentRequestBuilder()
                          .WithAmount(500m)
                          .WithCredtorAccountNumber("CredtorAccountNumber")
                          .WithDebtorAccountNumber("DebtorAccountNumber")
                          .WithPaymentDate(DateTime.Now)
                          .WithPaymentScheme(PaymentScheme.Bacs)
                          .Build();
 }
示例#3
0
 public WhenValidatingChapsPaymentForAccountWithNonChapsPaymentScheme()
 {
     chapsPaymentRule   = new ChapsPaymentRule();
     makePaymentRequest = new PaymentRequestBuilder()
                          .WithAmount(500m)
                          .WithCredtorAccountNumber("CredtorAccountNumber")
                          .WithDebtorAccountNumber("DebtorAccountNumber")
                          .WithPaymentScheme(PaymentScheme.Bacs)
                          .WithPaymentDate(DateTime.Now)
                          .Build();
     account = new AccountBuilder()
               .WithAccountNumber("AccountNumber")
               .WithAllowedPaymentSchemes(AllowedPaymentSchemes.FasterPayments)
               .WithBalance(1000m)
               .WithStatus(AccountStatus.Live)
               .Build();
 }
示例#4
0
        public WhenValidatingChapsPaymentForAccountWithInBoundPaymentOnlyStatus()
        {
            chapsPaymentRule   = new ChapsPaymentRule();
            makePaymentRequest = new PaymentRequestBuilder()
                                 .WithAmount(500m)
                                 .WithCredtorAccountNumber("CredtorAccountNumber")
                                 .WithDebtorAccountNumber("DebtorAccountNumber")
                                 .WithPaymentScheme(PaymentScheme.Chaps)
                                 .WithPaymentDate(DateTime.Now)
                                 .Build();

            account = new AccountBuilder()
                      .WithAccountNumber("AccountNumber")
                      .WithAllowedPaymentSchemes(AllowedPaymentSchemes.Chaps)
                      .WithBalance(501m)
                      .WithStatus(AccountStatus.InboundPaymentsOnly)
                      .Build();
        }