Ejemplo n.º 1
0
        public void GetPlayerByNameMethodTest()
        {
            var playerList = MockBuilder.GetPlayerList();

            GameBoard.GetBoard().SetPlayerList(playerList);
            var testPlayer = playerList[0];

            Assert.AreSame(GameBoard.GetBoard().GetPlayerByName("TestName1"), testPlayer);
        }
Ejemplo n.º 2
0
        public void GetPlayerByIndexMethodTest()
        {
            GameBoard.GetBoard().SetPlayerList(MockBuilder.GetPlayerList());
            var rnd      = GameBoard.GetBoard().GetRandom();
            var index    = rnd.Next(0, 5);
            var testList = MockBuilder.GetPlayerList();

            Assert.IsTrue(GameBoard.GetBoard().GetPlayerByIndex(index).Name == testList[index].Name);
        }
Ejemplo n.º 3
0
        public void SetPlayerTurnQueueMethodTest()
        {
            GameBoard.GetBoard().SetPlayerTurnQueue(MockBuilder.GetPlayerQueue());
            var rnd       = GameBoard.GetBoard().GetRandom();
            var index     = rnd.Next(0, 5);
            var queue     = GameBoard.GetBoard().GetPlayerList();
            var testQueue = MockBuilder.GetPlayerList();

            Assert.IsTrue(queue[index].Name == testQueue[index].Name);
        }
Ejemplo n.º 4
0
        public void TestGetPlayerColourIndexMethodReturnsInt()
        {
            var players = MockBuilder.GetPlayerList();

            players[2].Colour = 2;
            var board = GameBoard.GetBoard();

            board.SetPlayerList(players);

            Assert.IsTrue(GameEngine.GetPlayerColourIndex("TestName3") == 2);
        }
Ejemplo n.º 5
0
        public void TestCreateTurnQueueIsCorrectOrder()
        {
            var players = MockBuilder.GetPlayerList();

            GameBoard.GetBoard().SetPlayerList(players);
            var rnd    = GameBoard.GetBoard().GetRandom();
            var player = GameBoard.GetBoard().GetPlayerByIndex(rnd.Next(0, 5));

            var queue = GameEngine.CreateTurnQueue(player);

            Assert.IsTrue(queue.Dequeue().Name == player.Name);
        }