Example #1
0
        public void AdjustPastryCost_CalculatePastryDealAdjustmentWithLargeCount_IntAdjustment()
        {
            int pastries           = 50;
            int expectedAdjustment = 16;

            Pastry pastry = new Pastry();

            pastry.AdjustPastryCost(pastries);

            Assert.AreEqual(expectedAdjustment, pastry.DiscountAdjustment);
        }
Example #2
0
        public void CalcPastryTotalCost_CalculateTotalCostOfPastryOrderWithLargeCount_IntSum()
        {
            int pastries            = 50;
            int expectedPastryTotal = 84;

            Pastry pastry = new Pastry();

            pastry.AdjustPastryCost(pastries);
            pastry.CalcPastryTotalCost(pastries);

            Assert.AreEqual(expectedPastryTotal, pastry.PastryOrderTotalCost);
        }
Example #3
0
        public void CalcOrderTotalCost_CalculateCostOfBreadAndPastryOrdersWithZeroPastryCount_Int()
        {
            int loaves   = 6;
            int pastries = 0;
            int expectedOrderTotalCost = 20;

            Order  newOrder = new Order();
            Bread  bread    = new Bread();
            Pastry pastry   = new Pastry();

            bread.AdjustBreadCost(loaves);
            pastry.AdjustPastryCost(pastries);
            bread.CalcBreadTotalCost(loaves);
            pastry.CalcPastryTotalCost(pastries);
            newOrder.CalcOrderTotalCost(bread.BreadOrderTotalCost, pastry.PastryOrderTotalCost);

            Assert.AreEqual(expectedOrderTotalCost, newOrder.OrderTotalCost);
        }