コード例 #1
0
        public void WhenHaveInvalidExpirationDate_ShouldHaveError()
        {
            var sut = new PaymentRequestModelValidator();

            sut.ShouldHaveValidationErrorFor(m => m.ExpirationDate, DateTime.Now.AddDays(-1));
        }
コード例 #2
0
        public void WhenExpirationDateDefault_ShouldHaveError()
        {
            var sut = new PaymentRequestModelValidator();

            sut.ShouldHaveValidationErrorFor(m => m.ExpirationDate, new DateTime());
        }
コード例 #3
0
        public void WhenHaveInvalidCreditCardNumber_ShouldHaveError()
        {
            var sut = new PaymentRequestModelValidator();

            sut.ShouldHaveValidationErrorFor(m => m.CreditCardNumber, "123848484849");
        }
コード例 #4
0
        public void WhenCardHolderNull_ShouldHaveError()
        {
            var sut = new PaymentRequestModelValidator();

            sut.ShouldHaveValidationErrorFor(m => m.CardHolder, null as string);
        }
コード例 #5
0
        public void WhenAmountIsNegative_ShouldHaveError()
        {
            var sut = new PaymentRequestModelValidator();

            sut.ShouldHaveValidationErrorFor(m => m.Amount, -0.5);
        }