Example #1
0
        public void TestSalesAmountNegativeError()
        {
            Discount discount = new Discount();
            var      ex       = Assert.Throws <ArgumentException>(() => discount.calculateDiscount(-200.00F));

            Assert.That(ex.Message == " Sales Amount should not be 'Zero/Negative'");
        }
Example #2
0
        public void TestNoDiscount()
        {
            Discount discount = new Discount();
            double   discountPrice;

            discountPrice = discount.calculateDiscount(20000.00F);
            Assert.AreEqual(20000.00F, discountPrice);
        }
Example #3
0
        public void TestFiftyPercentDiscount()
        {
            Discount discount = new Discount();
            double   discountPrice;

            discountPrice = discount.calculateDiscount(10000.00F);
            Assert.AreEqual(5000.00F, discountPrice);
        }
Example #4
0
        public void TestTenPercentDiscount()
        {
            Discount discount = new Discount();
            double   discountPrice;

            discountPrice = discount.calculateDiscount(4000.00F);
            Assert.AreEqual(3600.00F, discountPrice);
        }
 public void TestNoDiscount()
 {
     Discount discountPrice = new Discount();
     double result = discountPrice.calculateDiscount(500);
     Assert.AreEqual(500, result);
 }
 public void TestExceptionwithCero()
 {
     Discount discountPrice = new Discount();
     discountPrice.calculateDiscount(0);
     Assert.Fail("ArgumentException");
 }
 public void TestDiscountPriceTenPercent()
 {
     Discount discountPrice = new Discount();
     double result = discountPrice.calculateDiscount(2000);
     Assert.AreEqual(1800, result);
 }
 public void TestDiscountPriceFivePercent()
 {
     Discount discountPrice = new Discount();
     double result = discountPrice.calculateDiscount(1900);
     Assert.AreEqual(1805, result);
 }
 public void TestDiscountPricefiftyPercent()
 {
     Discount discountPrice = new Discount();
     double result = discountPrice.calculateDiscount(5500);
     Assert.AreEqual(2750, result);
 }