public void TestDrinkCoffeeFromCardBooleanFalse() { PaymentTerminal terminal = new PaymentTerminal(); PaymentCard card = new PaymentCard(2); Assert.AreEqual(false, terminal.DrinkCoffee(card), "Buying coffee should return false if balance is not enough"); }
public void TestDrinkCoffeeFromCardBooleanTrue() { PaymentTerminal terminal = new PaymentTerminal(); PaymentCard card = new PaymentCard(5); Assert.AreEqual(true, terminal.DrinkCoffee(card), "Buying coffee should return true if balance is enough"); }
public void TestDrinkCoffeeFromCard() { PaymentTerminal terminal = new PaymentTerminal(); PaymentCard card = new PaymentCard(5); terminal.DrinkCoffee(card); Assert.AreEqual(Math.Round(Convert.ToDouble("2.5", System.Globalization.CultureInfo.InvariantCulture), 2), Math.Round(card.balance, 2), "Buying coffee should decrease tha amount by 2.5!"); }