예제 #1
0
        public void AdjustBreadCost_CalculateBreadDealAdjustmentWithZeroCount_IntAdjustment()
        {
            int loaves             = 0;
            int expectedAdjustment = 0;

            Bread bread = new Bread();

            bread.AdjustBreadCost(loaves);

            Assert.AreEqual(expectedAdjustment, bread.DiscountAdjustment);
        }
예제 #2
0
        public void CalcBreadTotalCost_CalculateTotalCostOfBreadOrderWithLargeCount_IntSum()
        {
            int loaves = 50;
            int expectedBreadTotalCost = 170;

            Bread bread = new Bread();

            bread.AdjustBreadCost(loaves);
            bread.CalcBreadTotalCost(loaves);
            bread.CalcBreadTotalCost(loaves);

            Assert.AreEqual(expectedBreadTotalCost, bread.BreadOrderTotalCost);
        }
예제 #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);
        }