Example #1
0
        public void TestDrinkTooMuchCoffee()
        {
            {
                PaymentCard card = new PaymentCard(9);
                card.DrinkCoffee();
                card.DrinkCoffee();
                card.DrinkCoffee();
                card.DrinkCoffee();
                card.DrinkCoffee();

                // Assert
                Assert.AreEqual("The card has a balance of 1 euros", card.ToString(), "You cannot drink coffee on credit!");
            }
        }
Example #2
0
        public void TestDrinkTooMuchCoffee()
        {
            {
                PaymentCard card = new PaymentCard(9);
                card.DrinkCoffee();
                card.DrinkCoffee();
                card.DrinkCoffee();
                card.DrinkCoffee();
                card.DrinkCoffee();

                // Assert
                Assert.AreEqual("The card has a balance of 1 euros", card.ToString(), "Do not exceed the balance to negative!");
            }
        }
Example #3
0
        public void TestDrinkCoffee()
        {
            {
                PaymentCard card = new PaymentCard(10);
                card.DrinkCoffee();

                // Assert
                Assert.AreEqual("The card has a balance of 8 euros", card.ToString(), "Drinking coffee should cost 2!");
            }
        }