Exemple #1
0
        public void PlayerDrinkPotionDisplayMessageTest()
        {
            OutputHelper.Display.ClearUserOutput();
            player.Inventory.Add(potion);
            string displayMessage = $"You drank a potion and replenished {potion.ManaAmount} mana.";

            potion.DrinkPotion(player);

            Assert.AreEqual(displayMessage, OutputHelper.Display.Output[0][2]);
        }
Exemple #2
0
        public void PlayerDrinkPotionPartialManaTest()
        {
            potion = new ManaPotion(PotionStrength.Greater);              // Greater mana potion restores 150 mana
            player.Inventory.Add(potion);
            player.MaxManaPoints = 200;
            player.ManaPoints    = 100;

            potion.DrinkPotion(player);

            Assert.AreEqual(player.MaxManaPoints, player.ManaPoints);
        }
Exemple #3
0
        public void PlayerDrinkPotionFullManaTest()
        {
            potion = new ManaPotion(PotionStrength.Greater);              // Greater mana potion restores 150 mana
            player.Inventory.Add(potion);
            player.MaxManaPoints = 200;
            player.ManaPoints    = 25;
            int?oldPlayerMana = player.ManaPoints;

            potion.DrinkPotion(player);

            Assert.AreEqual(oldPlayerMana + potion.ManaAmount, player.ManaPoints);
        }