Beispiel #1
0
        public void TestFoodManaEffect()
        {
            RegenerationEffect effect = new RegenerationEffect(RegenerationType.Mana, 20);

            _food = new Food(_name, _location, effect);
            Assert.AreEqual(effect, _food.Effect);
        }
Beispiel #2
0
        public void TestEatingFoodWithRegenerateManaEffect()
        {
            RegenerationEffect effect = new RegenerationEffect(RegenerationType.Mana, 10);
            Food food = new Food("Steak", new Location(), effect);

            //player lost half of its life
            _player.CurrentMana /= 2;
            //player eat food to regenerate health
            _player.Eat = true;
            _player.Eating(food);

            Assert.AreEqual(_maxMana, _player.CurrentMana);
        }
Beispiel #3
0
        public void TestEatingFoodWithRegenerateHealthEffect()
        {
            int expectedLife          = 100;
            RegenerationEffect effect = new RegenerationEffect(RegenerationType.Health, 200);
            Food food = new Food("Steak", new Location(), effect);

            //player lost half of its life
            _player.CurrentHealth /= 2;
            //player eat food to regenerate health
            _player.Eat = true;
            _player.Eating(food);

            Assert.AreEqual(expectedLife, _player.CurrentHealth);
        }
        public void TestEffectRegenerationHealthOnPlayerDuring2sec()
        {
            //GIVEN
            Player player = new Player(500, 5, 5, 5, 10, 50);

            player.CurrentHealth = 300;
            int expected = 400;

            //then we give effect to character
            _regenerationEffect = new RegenerationEffect(RegenerationType.Health, 100, 2);
            _regenerationEffect.RegenerationHealth((Character)player);
            //when
            Assert.AreEqual(expected, player.CurrentHealth);
        }
        public void TestEffectRegenerationHealthOnCharacterDuring2sec()
        {
            //GIVEN
            Character character = new Character(500, 5, 5, 5, 10);

            character.CurrentHealth = 300;
            int expected = 400;

            //then we give regeneration effect with a total value of 100 at to distribut in a duration of 2sc
            _regenerationEffect = new RegenerationEffect(RegenerationType.Health, 100, 2);
            _regenerationEffect.RegenerationHealth(character);
            //when
            Assert.AreEqual(expected, character.CurrentHealth);
        }
        public void TestEffectRegenerationHealthOnCharacter()
        {
            //GIVEN
            Character character = new Character(500, 5, 5, 5, 10);

            character.CurrentHealth = 300;
            int expected = 400;

            //then we give effect to character
            _regenerationEffect = new RegenerationEffect(RegenerationType.Health, 100);
            _regenerationEffect.RegenerationHealth(character);
            //when
            Assert.AreEqual(expected, character.CurrentHealth);
        }
        public void TestEffectRegenerationManaOnPlayer()
        {
            //GIVEN
            Player player = new Player(500, 5, 5, 5, 10, 20);

            player.CurrentMana = 10;
            int expected = 20;

            //then
            _regenerationEffect = new RegenerationEffect(RegenerationType.Mana, 10);
            _regenerationEffect.RegenerationMana(player);
            //when

            Assert.AreEqual(expected, player.CurrentMana);
        }