Esempio n. 1
0
        public void Heal_WhenHealsHerself_ReturnsUnalteredHealth()
        {
            FakeCharacter me = new FakeCharacter();

            HealService sut = new HealService();

            sut.Heal(100, me, me);

            Assert.Equal(1000, me.HealthPoints);
        }
Esempio n. 2
0
        public void SomeTempAndCurrentDeficit_shouldHealCurrentAndNotChangeTemp()
        {
            var expectedCharacter = MakeCharacter(20, 20, 20);

            var healService     = new HealService();
            var actualCharacter = MakeCharacter(20, 10, 20);

            healService.HealCharacter(actualCharacter, 15);

            actualCharacter.Should().BeEquivalentTo(expectedCharacter);
        }
Esempio n. 3
0
        public void SomeTempAndMaxCurrent_shouldNotChangeCurrentOrTemp()
        {
            var expectedCharacter = MakeCharacter(20, 20, 20);

            var healService     = new HealService();
            var actualCharacter = MakeCharacter(20, 20, 20);

            healService.HealCharacter(actualCharacter, 10);

            actualCharacter.Should().BeEquivalentTo(expectedCharacter);
        }
Esempio n. 4
0
        public void NoTempAndHealMoreThanDeficit_shouldHealToMax()
        {
            var expectedCharacter = MakeCharacter(20, 20, 0);

            var healService     = new HealService();
            var actualCharacter = MakeCharacter(20, 10, 0);

            healService.HealCharacter(actualCharacter, 15);

            actualCharacter.Should().BeEquivalentTo(expectedCharacter);
        }
Esempio n. 5
0
        public void Heal_WhenCharactersArentAllies_ReturnsSubtractedHealth()
        {
            Faction faction  = new Faction(1);
            Faction faction2 = new Faction(2);

            FakeCharacter ally = new FakeCharacter();

            ally.JoinFaction(faction);

            FakeCharacter enemy = new FakeCharacter();

            enemy.SetDamage(100);
            enemy.JoinFaction(faction2);

            HealService sut = new HealService();

            sut.Heal(100, ally, enemy);

            Assert.Equal(900, enemy.HealthPoints);
        }
Esempio n. 6
0
        public void Heal_WhenCharactersAreAllies_ReturnsAddedHealth()
        {
            Faction faction  = new Faction(1);
            Faction faction2 = new Faction(2);

            FakeCharacter ally = new FakeCharacter();

            ally.SetDamage(100);
            ally.JoinFaction(faction);

            FakeCharacter ally2 = new FakeCharacter();

            ally2.JoinFaction(faction);

            HealService sut = new HealService();

            sut.Heal(100, ally2, ally);

            Assert.Equal(1000, ally.HealthPoints);
        }