示例#1
0
        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");
        }
示例#2
0
        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");
        }
示例#3
0
        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!");
        }