public void ShouldReceiveTheSameAmountDeposited() { ui.PerformAction(MainMenu.Commands.AddMoney + " 1.25"); string result = ui.PerformAction(MainMenu.Commands.ReturnChange.Command); Assert.IsTrue(result.Contains("1.25")); }
public void ShouldDisplayMachineBalance() { machine.DepositMachineMoney(5); string result = ui.PerformAction(AdminMenu.Commands.ViewMachineBalance.Command); Assert.IsTrue(result.Contains("$5.00")); }
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)); }
public void ShouldRenderProductList() { machine.Slots[2].ProductName = "Dr. Pepper"; machine.Slots[3].ProductName = "Coca Cola"; string result = ui.PerformAction(MainMenu.Commands.ViewProductList.Command); string[] lines = result.Split('\n'); Assert.IsTrue(lines[2].Contains("3")); Assert.IsTrue(lines[2].Contains("Dr. Pepper")); Assert.IsTrue(lines[3].Contains("4")); Assert.IsTrue(lines[3].Contains("Coca Cola")); }
public void ShouldRenderViewInventory() { machine.Slots[2].ProductName = "Dr. Pepper"; machine.Slots[2].Quantity = 9; machine.Slots[3].ProductName = "Coca Cola"; machine.Slots[3].Quantity = 11; string result = ui.PerformAction(AdminMenu.Commands.ViewInventory.Command).ToString(); string[] lines = result.Split('\n'); Assert.IsTrue(lines[2].Contains("3")); Assert.IsTrue(lines[2].Contains("9")); Assert.IsTrue(lines[2].Contains("Dr. Pepper")); Assert.IsTrue(lines[3].Contains("4")); Assert.IsTrue(lines[3].Contains("11")); Assert.IsTrue(lines[3].Contains("Coca Cola")); }
public void SetUp() { machine = new SodaMachine(10); ui = new SodaMachineUi(machine); ui.PerformAction(MainMenu.Commands.StockerMenu.Command); }
public void ShouldBeAbleToNameAnItem() { ui.PerformAction(AdminMenu.Commands.NameItems.Command + " 1 Coca Cola"); Assert.AreEqual("Coca Cola", machine.Slots[0].ProductName); }
public void ShouldUpdateCustomerBalance() { ui.PerformAction(MainMenu.Commands.AddMoney + " " + "1.25"); Assert.AreEqual(1.25, machine.CustomerBalance); }
public void ShouldDisplaySubMenu() { ui.PerformAction(MainMenu.Commands.StockerMenu.Command); Assert.IsInstanceOfType(ui.ActiveController, typeof(AdminMenu)); }
public void ShouldBeAbleToAddItems() { ui.PerformAction(AdminMenu.Commands.AdjustQuantity.Command + " 1 1"); Assert.AreEqual(1, machine.Slots[0].Quantity); }
public void ShouldBeAbleToSelectAnItem() { machine.DepositCustomerMoney(2); ui.PerformAction(MainMenu.Commands.ChooseItem.Command + " 1"); Assert.AreEqual(9, machine.Slots[0].Quantity); }