public void TestHighestRollreturnsAWinner() { var players = MockBuilder.GetPlayerList(); var winner = GameEngine.HighestRoll(players); Assert.IsTrue(winner == players[0] || winner == players[1] || winner == players[2] || winner == players[3] || winner == players[4] || winner == players[5]); }
public void TestGetPlayerIndexMethodReturnsIndex() { var players = MockBuilder.GetPlayerList(); var board = GameBoard.GetBoard(); board.SetPlayerList(players); Assert.IsTrue(GameEngine.GetPlayerIndex("TestName3") == 2); }
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 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); }