예제 #1
0
        public void OldPriceNullTest()
        {
            decimal?      oldPrice = null;
            const decimal price    = 2000.00m;
            const int     actual   = 0;
            var           discount = DiscountHelper.CalculateDiscount(price, oldPrice);

            Assert.AreEqual(discount, actual);
        }
예제 #2
0
        public void DiscountsFractionalTest1()
        {
            decimal?      oldPrice = 1856.00m;
            const decimal price    = 1324.00m;
            const int     actual   = 28;
            var           discount = DiscountHelper.CalculateDiscount(price, oldPrice);

            Assert.AreEqual(discount, actual);
        }
예제 #3
0
        public void DiscountsFractionalTest2()
        {
            decimal?      oldPrice = 1248.34m;
            const decimal price    = 793.65m;
            const int     actual   = 36;
            var           discount = DiscountHelper.CalculateDiscount(price, oldPrice);

            Assert.AreEqual(discount, actual);
        }
예제 #4
0
        public void DiscountsIntegerTest()
        {
            decimal?      oldPrice = 1000.00m;
            const decimal price    = 800.00m;
            const int     actual   = 20;
            var           discount = DiscountHelper.CalculateDiscount(price, oldPrice);

            Assert.AreEqual(discount, actual);
        }