Exemplo n.º 1
0
        public void NullAccountFailsValidation()
        {
            BacsPaymentValidator sut = GetSystemUnderTest();

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

            Assert.False(result);
        }
        public void BacsPaymentValidator_AllowedPaymentSchemes_ReturnsValid()
        {
            var bacs = new BacsPaymentValidator();

            var account = new Account {
                AllowedPaymentSchemes = AllowedPaymentSchemes.Bacs
            };

            Assert.True(bacs.IsValid(account, 0));
        }
        public void BacsPaymentValidator_AccountHasInValidPaymentSchemes_ReturnsInValid()
        {
            var bacs = new BacsPaymentValidator();

            var account = new Account {
                AllowedPaymentSchemes = AllowedPaymentSchemes.Chaps
            };

            Assert.False(bacs.IsValid(account, 0));
        }
        public void CheckPaymentValid_False_IfAccountNull()
        {
            var bacsPaymentValidator = new BacsPaymentValidator();

            var     request = new MakePaymentRequest();
            Account account = null;

            var validationResult = bacsPaymentValidator.CheckPaymentValid(request, account);

            Assert.That(validationResult, Is.False);
        }
Exemplo n.º 5
0
        public void AllowsBacsPassessValidation(AllowedPaymentSchemes schemes)
        {
            BacsPaymentValidator sut = GetSystemUnderTest();
            Account account          = _fixture.Create <Account>();

            account.AllowedPaymentSchemes = schemes;

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

            Assert.True(result);
        }
        public void CheckPaymentValid_True_IfAllowedSchemesBacs()
        {
            var bacsPaymentValidator = new BacsPaymentValidator();

            var     request = new MakePaymentRequest();
            Account account = new Account {
                AllowedPaymentSchemes = AllowedPaymentSchemes.Bacs
            };

            var validationResult = bacsPaymentValidator.CheckPaymentValid(request, account);

            Assert.That(validationResult, Is.True);
        }
Exemplo n.º 7
0
 public void SetUp()
 {
     bacsPaymentValidator = new BacsPaymentValidator();
 }