コード例 #1
0
        public void TestThatPaymentCannotBeMade_BeforeTotal()
        {
            sale.BuyItems(inventory.FindItem(1), 6);
            sale.BuyItems(inventory.FindItem(2), 6);
            sale.BuyItems(inventory.FindItem(3), 6);

            sale.MakePayment(40.00M);

            Assert.AreEqual(0, sale.AmountDue);
        }
コード例 #2
0
 public void TestThatSaleStateSwitchesToCompletedState_WhenAFullPaymentIsMadeAfterBeingTotalled()
 {
     sale.BuyItems(inventory.FindItem(2), 3);
     sale.TotalSale();
     sale.MakePayment(15M);
     Assert.IsTrue(sale.SaleState is CompletedSaleState);
 }