Пример #1
0
        public void CharactersDieWhenDamageTakenExceedsHealth()
        {
            var attacker = new MeleeFighter();
            var target   = new MeleeFighter();

            attacker.DealDamageTo(target, 1001);

            target.IsAlive.Should().BeFalse();
        }
Пример #2
0
        public void HealingCannotRaiseHealthAbove1000()
        {
            var first  = new MeleeFighter();
            var second = new MeleeFighter();

            first.DealDamageTo(second, 100);
            second.HealSelf(200);

            second.Health.Should().Be(1000);
        }
Пример #3
0
        public void WhenDealingDamageToTarget5LevelsAboveDamageIsReducedBy50Pct()
        {
            var attacker = new MeleeFighter();
            var target   = new MeleeFighter();

            target.RaiseLevelTo(6);
            attacker.DealDamageTo(target, 100);

            target.Health.Should().Be(950);
        }
Пример #4
0
        public void DeadCharactersCannotBeHealed()
        {
            var attacker = new MeleeFighter();
            var target   = new MeleeFighter();

            attacker.DealDamageTo(target, 1001);

            target.CanHealSelf().Should().BeFailure();
            attacker.CanHeal(target).Should().BeFailure();
        }
Пример #5
0
        public void WhenDealingDamageToTarget5LevelsBelowDamageIsIncreasedBy50Pct()
        {
            var attacker = new MeleeFighter();
            var target   = new MeleeFighter();

            attacker.RaiseLevelTo(6);
            attacker.DealDamageTo(target, 100);

            target.Health.Should().Be(850);
        }