Ejemplo n.º 1
0
        public void GivenFirstCharacterHasConstitutionWithNegative_5_ThenCharacterIsNotDeadInitially()
        {
            var game = new EvercraftGame();

            game.Start("Jack", "Bob");
            game.ApplyConstitution(1, game.Chars[0]);

            game.IsDead(game.Chars[0]).Should().Be(false);
        }
Ejemplo n.º 2
0
        public void GivenSecondCharacterHasConstitutionWithNegative_5_ModifierWhenRollIsGreaterThanArmorThenSecondCharacterDies()
        {
            var game = new EvercraftGame();

            game.Start("Jack", "Bob");
            game.ApplyConstitution(1, game.Chars[1]);

            game.Attack(10, game.Chars[1]);

            game.IsDead(game.Chars[1]).Should().Be(true);
        }
Ejemplo n.º 3
0
        public void GivenFirstCharacterHasConstitutionWithPositiveModifierWhenRollIsGreaterThanArmorThenFirstCharacterIsAliveAfterAttacks(int constitution, int attacks)
        {
            var game = new EvercraftGame();

            game.Start("Jack", "Bob");
            game.ApplyConstitution(constitution, game.Chars[0]);

            for (var i = 0; i < attacks; i++)
            {
                game.Attack(10, game.Chars[0]);
            }

            game.IsDead(game.Chars[0]).Should().Be(false);
        }
Ejemplo n.º 4
0
        public void GivenCharacterHasOneHitPointLeftWhenRollIsGreaterThanArmorThenCharacterIsDead()
        {
            var game = new EvercraftGame();

            game.Start("Jack", "Bob");
            game.Attack(11, game.Chars[1]);
            game.Attack(11, game.Chars[1]);
            game.Attack(11, game.Chars[1]);
            game.Attack(11, game.Chars[1]);

            game.Attack(11, game.Chars[1]);

            game.Chars[1].HitPts.Should().Be(0);
            game.IsDead(game.Chars[1]).Should().Be(true);
        }