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

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

            Assert.False(result);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }