Пример #1
0
        public void Should_Have_Validation_Error_For_Invalid_Amount()
        {
            var validator = new PaymentRequestValidator();

            validator.ShouldHaveValidationErrorFor(request => request.Amount, -0.003m);
            validator.ShouldHaveValidationErrorFor(request => request.Amount, -1);
        }
Пример #2
0
        public void Should_Have_Validation_Error_For_Invalid_Cvv()
        {
            var validator = new PaymentRequestValidator();

            validator.ShouldHaveValidationErrorFor(request => request.Cvv, null as string);
            validator.ShouldHaveValidationErrorFor(request => request.Cvv, "");
            validator.ShouldHaveValidationErrorFor(request => request.Cvv, "abc1");
        }
 public void PaymentRequestValidator_Should_Error_When_Card_Is_Null()
 {
     _validator.ShouldHaveValidationErrorFor(x => x.Card, (Card)null);
 }
Пример #4
0
        public void WhenCurrencyIsNull_ShouldHaveError(string currency)
        {
            var sut = new PaymentRequestValidator();

            sut.ShouldHaveValidationErrorFor(x => x.Currency, currency);
        }
Пример #5
0
        public void WhenOrderIdIsNull_ShouldHaveError(string orderId)
        {
            var sut = new PaymentRequestValidator();

            sut.ShouldHaveValidationErrorFor(x => x.OrderId, orderId);
        }
Пример #6
0
        public void WhenExpiryDateIsNullOrInWrongFormat_ShouldHaveError(string expiryDate)
        {
            var sut = new PaymentRequestValidator();

            sut.ShouldHaveValidationErrorFor(x => x.ExpiryDate, expiryDate);
        }
Пример #7
0
        public void WhenCvvIsNullOrInWrongFormat_ShouldHaveError(string cvv)
        {
            var sut = new PaymentRequestValidator();

            sut.ShouldHaveValidationErrorFor(x => x.Cvv, cvv);
        }
Пример #8
0
        public void WhenCardNumberIsNullOrInWrongFormat_ShouldHaveError(string cardNumber)
        {
            var sut = new PaymentRequestValidator();

            sut.ShouldHaveValidationErrorFor(x => x.CardNumber, cardNumber);
        }
Пример #9
0
        public void WhenMerchantIdIsInvalid_ShouldHaveError(string merchantId)
        {
            var sut = new PaymentRequestValidator();

            sut.ShouldHaveValidationErrorFor(x => x.MerchantId, merchantId);
        }
Пример #10
0
        public void WhenAmountIsNegative_ShouldHaveError(decimal amount)
        {
            var sut = new PaymentRequestValidator();

            sut.ShouldHaveValidationErrorFor(x => x.Amount, amount);
        }
Пример #11
0
        public void Should_Have_Validation_Error_For_Invalid_CardNumber(string cardNumber)
        {
            var validator = new PaymentRequestValidator();

            validator.ShouldHaveValidationErrorFor(request => request.CardNumber, cardNumber);
        }