public void GivenASoldier_WhenTwoSoldiersWithEqualWeaponDamageFight_TheAttackerWins()
        {
            Soldier attacker    = new Soldier("Attacker", 0);
            Soldier attackedOne = new Soldier("Attacked one", 0);

            Soldier winner = attacker.Fight(attackedOne);

            winner.Should().Be(attacker);
        }
示例#2
0
        public void Soldier_whenAttacksAnotherSoldier_ShouldWin()
        {
            var john  = new Soldier("john");
            var smith = new Soldier("smith");

            john.Weapon.Type  = Weapon.EWeaponType.Axe;
            smith.Weapon.Type = Weapon.EWeaponType.BareFist;

            var result = john.Fight(smith, A.Fake <IAttacker>());

            result.Should().Be(john);
        }
示例#3
0
        public void Soldier_whenCombatantsMatchedAttackerWins()
        {
            var john  = new Soldier("john");
            var smith = new Soldier("smith");

            john.Weapon.Type  = Weapon.EWeaponType.BareFist;
            smith.Weapon.Type = Weapon.EWeaponType.BareFist;

            var attacker = A.Fake <IAttacker>();

            A.CallTo(() => attacker.GetAttacker(john, smith)).Returns(john);

            var result = john.Fight(smith, attacker);

            result.Should().Be(john);
        }