示例#1
0
        public void ACharacterMayJoinOneOrMoreFactions()
        {
            var character = new MeleeFighter();

            character.JoinFaction("a");
            character.JoinFaction("b");

            character.Factions.Should().HaveCount(2);
            character.Factions.Should().Contain(new[] { "a", "b" });
        }
示例#2
0
        public void PlayersBelongingToTheSameFactionAreConsideredAllies()
        {
            var player1 = new MeleeFighter();
            var player2 = new MeleeFighter();

            player1.JoinFaction("a");
            player2.JoinFaction("a");

            player1.IsAlliesWith(player2).Should().BeTrue();
        }
示例#3
0
        public void AlliesCanHealOneAnother()
        {
            var player1 = new MeleeFighter();
            var player2 = new MeleeFighter();

            player1.JoinFaction("a");
            player2.JoinFaction("a");

            player1.CanHeal(player2).Should().BeSuccessful();
            player2.CanHeal(player1).Should().BeSuccessful();
        }
示例#4
0
        public void AlliesCannotDealDamageToOneAnother()
        {
            var player1 = new MeleeFighter();
            var player2 = new MeleeFighter();

            player1.JoinFaction("a");
            player2.JoinFaction("a");

            player1.CanDealDamageTo(player2).Should().BeFailure();
            player2.CanDealDamageTo(player1).Should().BeFailure();
        }