コード例 #1
0
        public void ShouldPrintCorrectCustomerBalance()
        {
            SodaMachine   machine   = new SodaMachine(10);
            SodaMachineUi machineUi = new SodaMachineUi(machine);

            machine.DepositCustomerMoney(2.25);
            string result = machineUi.PerformAction(MainMenu.Commands.PrintCustomerBalance.Command).ToString();

            Assert.IsTrue(result.Contains("2.25"), string.Format("Result should contain 2.25, actual result was {0}", result));
        }
コード例 #2
0
 public void ShouldBeAbleToSelectAnItem()
 {
     machine.DepositCustomerMoney(2);
     ui.PerformAction(MainMenu.Commands.ChooseItem.Command + " 1");
     Assert.AreEqual(9, machine.Slots[0].Quantity);
 }