예제 #1
0
        public void ShouldValidateForAmountsGreaterThanMinimumAndFailOtherwise(decimal donationAmount, bool expectedResult)
        {
            IValidationRule <decimal> validator = new MinimumDonationValidator();

            bool result = validator.Validates(donationAmount);

            Assert.That(result, Is.EqualTo(expectedResult));
        }
예제 #2
0
        public void ShouldReturnTheExpectedErrorCodeAndDescriptionForFailedValidations()
        {
            IValidationRule <decimal> validator = new MinimumDonationValidator();

            bool result = validator.Validates(1m);

            Assert.That(result, Is.EqualTo(false));
            Assert.That(validator.Error.ErrorCode, Is.EqualTo(MinimumValidationErrorCode));
            Assert.That(validator.Error.ErrorDescription, Is.EqualTo(MinimumValidationErrorDescription));
        }