Exemple #1
0
    public void TurnIsSkippedIfTheyHaveNoAvailableMoves()
    {
        var hive    = HiveFactory.Create(new[] { "player1", "player2" });
        var player1 = hive.Players[0];
        var player2 = hive.Players[1] with {
            Tiles = new HashSet <Tile>(), Name = "test player", Id = 1
        };

        hive = new Hive(
            new List <Player>
        {
            player1, player2
        },
            hive.Cells
            );

        hive.Move(new Move(player1.Tiles.First(), new Coords(0, 0)));

        var allTiles = hive.Cells.SelectMany(c => c.Tiles).Concat(hive.Players.SelectMany(p => p.Tiles)).ToList();

        allTiles.Should().NotContain(t => t.PlayerId == player2.Id);
        allTiles.Where(t => t.PlayerId == player1.Id).Should().NotBeEmpty();
    }
}