Exemple #1
0
        public void NullAccountFailsValidation()
        {
            ChapsPaymentValidator sut = GetSystemUnderTest();

            bool result = sut.ValidatePayment(null, It.IsAny <decimal>());

            Assert.False(result);
        }
Exemple #2
0
        public void DoesNotAllowChapsFailsValidation(AllowedPaymentSchemes schemes)
        {
            ChapsPaymentValidator sut = GetSystemUnderTest();
            Account account           = _fixture.Create <Account>();

            account.AllowedPaymentSchemes = schemes;

            bool result = sut.ValidatePayment(account, It.IsAny <decimal>());

            Assert.False(result);
        }
Exemple #3
0
        public void AllowsChapsPassessValidation(AllowedPaymentSchemes schemes)
        {
            ChapsPaymentValidator sut = GetSystemUnderTest();
            Account account           = _fixture.Create <Account>();

            account.Status = AccountStatus.Live;
            account.AllowedPaymentSchemes = schemes;

            bool result = sut.ValidatePayment(account, It.IsAny <decimal>());

            Assert.True(result);
        }
Exemple #4
0
        public void NonLiveStatusFailsValidation(AccountStatus status)
        {
            ChapsPaymentValidator sut = GetSystemUnderTest();
            Account account           = _fixture.Create <Account>();

            account.Status = status;
            account.AllowedPaymentSchemes = AllowedPaymentSchemes.Chaps;

            bool result = sut.ValidatePayment(account, It.IsAny <decimal>());

            Assert.False(result);
        }