public void ValidateValidLimitSpecialReturnsSuccess()
        {
            IValidator <ISpecial> specialsValidator = new SpecialsValidator();

            var result = specialsValidator.Validate(validLimitSpecial);

            Assert.AreEqual(result.IsValid, true);
            Assert.AreEqual(result.Message, "Success.");
        }
        public void ValidateLimitSpecialWithoutDiscountAmountReturnsError()
        {
            IValidator <ISpecial> specialsValidator = new SpecialsValidator();

            var result = specialsValidator.Validate(limitSpecialWithoutDiscountAmount);

            Assert.AreEqual(result.IsValid, false);
            Assert.AreEqual(result.Message, "Error: Discount amount must be bigger than zero.");
        }
        public void ValidatePriceSpecialWithPurchaseQuantityLessThanTwoReturnsError()
        {
            IValidator <ISpecial> specialsValidator = new SpecialsValidator();

            var result = specialsValidator.Validate(lessThanTwoQuantityPriceSpecial);

            Assert.AreEqual(result.IsValid, false);
            Assert.AreEqual(result.Message, "Error: Purchase quantity must be bigger than 1.");
        }
        public void ValidatePriceSpecialWithZeroPriceReturnsError()
        {
            IValidator <ISpecial> specialsValidator = new SpecialsValidator();

            var result = specialsValidator.Validate(zeroPriceSpecial);

            Assert.AreEqual(result.IsValid, false);
            Assert.AreEqual(result.Message, "Error: Price must be bigger than 0.");
        }
        public void ValidateRestrictionSpecialWithZeroDiscountQuantityReturnsError()
        {
            IValidator <ISpecial> specialsValidator = new SpecialsValidator();

            var result = specialsValidator.Validate(restrictionSpecialWithZeroDiscountQuantity);

            Assert.AreEqual(result.IsValid, false);
            Assert.AreEqual(result.Message, "Error: Discount quantity must be bigger than zero.");
        }
        public void ValidateLimitSpecialWithLimitNotAMultipleOfPurchaseQtyPlusDiscountQtyReturnsError()
        {
            IValidator <ISpecial> specialsValidator = new SpecialsValidator();

            var result = specialsValidator.Validate(limitSpecialWithLimitNotAMultipleOfPurchaseQtyPlusDiscountQty);

            Assert.AreEqual(result.IsValid, false);
            Assert.AreEqual(result.Message, "Error: Limit must be a multiple of purchase quantity plus discount quantity.");
        }
        public void ValidateLimitSpecialWithSmallerLimitThanPurchaseQuantityReturnsError()
        {
            IValidator <ISpecial> specialsValidator = new SpecialsValidator();

            var result = specialsValidator.Validate(limitSpecialWithLimitLessThanPurchaseQty);

            Assert.AreEqual(result.IsValid, false);
            Assert.AreEqual(result.Message, "Error: Limit must be bigger than purchase quantity.");
        }