Beispiel #1
0
        public void GetUsedCardsMethodTest()
        {
            var cardDeck = MockBuilder.GetDeckOfCards();

            GameBoard.GetBoard().SetUsedCards(cardDeck);

            Assert.IsNotNull(GameBoard.GetBoard().GetUsedCards());
        }
Beispiel #2
0
        public void TestGetPlayerIndexMethodReturnsIndex()
        {
            var players = MockBuilder.GetPlayerList();
            var board   = GameBoard.GetBoard();

            board.SetPlayerList(players);

            Assert.IsTrue(GameEngine.GetPlayerIndex("TestName3") == 2);
        }
Beispiel #3
0
        public void GetPlayerByNameMethodTest()
        {
            var playerList = MockBuilder.GetPlayerList();

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

            Assert.AreSame(GameBoard.GetBoard().GetPlayerByName("TestName1"), testPlayer);
        }
Beispiel #4
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);
        }
Beispiel #5
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);
        }
Beispiel #6
0
        public void TestCheckMapIsFull()
        {
            var board = GameBoard.GetBoard();

            foreach (var territory in board.GetEarth().Territories)
            {
                territory.Occupant = "TestName";
            }

            Assert.IsTrue(BoardPopulator.CheckMapIsFull(board));
        }
Beispiel #7
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);
        }
Beispiel #8
0
        public void GetTerritoryByName()
        {
            var board           = GameBoard.GetBoard();
            var earth           = board.GetEarth();
            var testTerritory   = board.GetTerritoryByName("China");
            var sampleTerritory = new Territory();

            foreach (var territory in earth.Territories)
            {
                if (territory.Name == "China")
                {
                    sampleTerritory = territory;
                    continue;
                }
            }

            Assert.AreSame(testTerritory, sampleTerritory);
        }
Beispiel #9
0
 public void GetPlayerListMethodTest()
 {
     Assert.IsNotNull(GameBoard.GetBoard().GetPlayerList());
 }
Beispiel #10
0
 public void GetTradedCardSetsMethodTest()
 {
     Assert.Zero(GameBoard.GetBoard().GetTradedCardSets());
 }
Beispiel #11
0
 public void GetCardMethodTest()
 {
     Assert.IsNotNull(GameBoard.GetBoard().GetGameCard());
 }
Beispiel #12
0
 public void GetEarthMethodTest()
 {
     Assert.IsNotNull(GameBoard.GetBoard().GetEarth());
 }
Beispiel #13
0
 public void GetRandomMethodTest()
 {
     Assert.IsNotNull(GameBoard.GetBoard().GetRandom());
 }
Beispiel #14
0
 public void GetBoardMethodTest()
 {
     Assert.IsInstanceOf <GameBoard>(GameBoard.GetBoard());
 }
Beispiel #15
0
 public void TestGameBoardConstructor()
 {
     Assert.IsNotNull(GameBoard.GetBoard());
 }