Exemplo n.º 1
0
        public void RunFirstGameTest()
        {
            var players        = this.CreatePlayersCollection(4);
            var gameController = new AllToAllGameController(players, new AllToAllOponentsCreator());
            var oponents       = gameController.GamesInSortedQueue.Select(games => games.Oponents).ToList();

            Assert.IsTrue(gameController.CurrentGameOponents() == oponents.First());
        }
Exemplo n.º 2
0
        public void EndGamesFromManyTest()
        {
            var players        = this.CreatePlayersCollection(3);
            var gameController = new AllToAllGameController(players, new AllToAllOponentsCreator());
            var oponents       = gameController.CurrentGameOponents();

            gameController.EndGame(oponents.TeamA);
            Assert.IsTrue(gameController.IsNextGameAvailable);
        }
Exemplo n.º 3
0
        public void EndGamesTie()
        {
            var players        = this.CreatePlayersCollection(2);
            var gameController = new AllToAllGameController(players, new AllToAllOponentsCreator());
            var oponents       = gameController.CurrentGameOponents();
            var winners        = oponents.TeamA.Concat(oponents.TeamB).ToList();

            gameController.EndGameAsTie();
            Assert.IsFalse(gameController.IsNextGameAvailable);

            foreach (var winner in winners)
            {
                Assert.IsTrue(gameController.Players.Find(player => player.Player == winner).Points == 1);
            }
        }