public void ShouldValidateForAmountsGreaterThanMinimumAndFailOtherwise(decimal donationAmount, bool expectedResult) { IValidationRule <decimal> validator = new MinimumDonationValidator(); bool result = validator.Validates(donationAmount); Assert.That(result, Is.EqualTo(expectedResult)); }
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)); }