public void GetPlayerByNameMethodTest() { var playerList = MockBuilder.GetPlayerList(); GameBoard.GetBoard().SetPlayerList(playerList); var testPlayer = playerList[0]; Assert.AreSame(GameBoard.GetBoard().GetPlayerByName("TestName1"), testPlayer); }
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); }
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); }
public void TestGetPlayerColourIndexMethodReturnsInt() { var players = MockBuilder.GetPlayerList(); players[2].Colour = 2; var board = GameBoard.GetBoard(); board.SetPlayerList(players); Assert.IsTrue(GameEngine.GetPlayerColourIndex("TestName3") == 2); }
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); }