public void TestEatLunchFromCardBooleanTrue() { PaymentTerminal terminal = new PaymentTerminal(); PaymentCard card = new PaymentCard(11); Assert.AreEqual(true, terminal.EatLunch(card), "Buying coffee should return true if balance is enough"); }
public void TestEatLunchFromCardBooleanFalse() { PaymentTerminal terminal = new PaymentTerminal(); PaymentCard card = new PaymentCard(2); Assert.AreEqual(false, terminal.EatLunch(card), "Buying coffee should return false if balance is not enough"); }
public void TestEatLunchFromCardNotEnoughMoney() { PaymentTerminal terminal = new PaymentTerminal(); PaymentCard card = new PaymentCard(10); terminal.EatLunch(card); Assert.AreEqual(10, card.balance, "Lunch should not decrease the balance if there is not enough money!"); }
public void TestEatLunchFromCard() { PaymentTerminal terminal = new PaymentTerminal(); PaymentCard card = new PaymentCard(11); terminal.EatLunch(card); Assert.AreEqual(Math.Round(Convert.ToDouble("0.7", System.Globalization.CultureInfo.InvariantCulture), 2), Math.Round(Convert.ToDouble(card.balance, System.Globalization.CultureInfo.InvariantCulture), 2), "Lunch should decrease the balance by 10.3!"); }