コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameState" /> class.
 /// Constructor for game state classes. Allows you to pass in and set
 /// all properties at once.
 /// </summary>
 /// <param name="gameBoard">the value for the GameBoard private member</param>
 /// <param name="playerList">the value for the PlayerList private member</param>
 /// <param name="tileBag">the value for the TileBag private member</param>
 /// <param name="playerOrder">the value for the PlayerOrder private member</param>
 /// <param name="recentPlay">the value for the RecentPlay private member</param>
 public GameState(Board gameBoard, List<PlayerClass.Player> playerList, Bag tileBag, TurnOrder playerOrder, Play recentPlay)
 {
     this.GameBoard = gameBoard;
     this.PlayerList = playerList;
     this.TileBag = tileBag;
     this.PlayerOrder = playerOrder;
     this.RecentPlay = recentPlay;
 }
コード例 #2
0
ファイル: BagTests.cs プロジェクト: murple13/Scrabble_CS3450
        public void DrawLetterTileTest()
        {
            // Make a bag, and make sure that you can draw tiles from it
            // equal to its starting LetterTileCount.
            Bag bag = new Bag();
            int letterTileCount = bag.LetterTileCount;
            List<LetterTile> ltl = new List<LetterTile>();
            try
            {
                for (int i = 0; i < letterTileCount; ++i)
                {
                    ltl.Add(bag.DrawLetterTile());
                }
            }
            catch
            {
                Assert.Fail();
            }
            // There should be 100 tiles in the bag to start with.
            Assert.IsTrue(ltl.Count == 100);

            // Make sure the point values of the LetterTile add to 187.
            int totalPoints = 0;

            for(int i = 0; i < ltl.Count; ++i)
            {
                totalPoints += ltl[i].PointValue;
            }
            Assert.IsTrue(totalPoints == 187);

            // Make sure that drawing from an empty bag throws an exception.
            bool exceptionWasThrown = false;
            try
            {
                bag.DrawLetterTile();
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);

            // Make sure it's possible to put all the LetterTiles back into the bag.
            try
            {
                foreach(LetterTile lt in ltl)
                {
                    bag.InsertLetterTile(lt);
                }
            }
            catch
            {
                Assert.Fail();
            }
        }
コード例 #3
0
ファイル: BagTests.cs プロジェクト: murple13/Scrabble_CS3450
 public void BagTest()
 {
     bool exceptionWasThrown = false;
     try
     {
         Bag bag = new Bag();
     }
     catch
     {
         exceptionWasThrown = true;
     }
     Assert.IsFalse(exceptionWasThrown);
 }
コード例 #4
0
ファイル: BagTests.cs プロジェクト: murple13/Scrabble_CS3450
 public bool ExceptionGotThrown(char letterValue, int pointValue, Bag bag)
 {
     bool exceptionWasThrown = false;
     try
     {
         bag.InsertLetterTile(new LetterTile(letterValue, pointValue));
     }
     catch
     {
         exceptionWasThrown = true;
     }
     return exceptionWasThrown;
 }
コード例 #5
0
ファイル: BagTests.cs プロジェクト: murple13/Scrabble_CS3450
        public void InsertLetterTileTest()
        {
            Bag bag = new Bag();

            // Make sure an exception is thrown if any LetterTile is added to a full bag.
            Assert.IsTrue(
                ExceptionGotThrown(' ', 0, bag) &&
                ExceptionGotThrown('A', 1, bag) &&
                ExceptionGotThrown('B', 3, bag) &&
                ExceptionGotThrown('C', 3, bag) &&
                ExceptionGotThrown('D', 2, bag) &&
                ExceptionGotThrown('E', 1, bag) &&
                ExceptionGotThrown('F', 4, bag) &&
                ExceptionGotThrown('G', 2, bag) &&
                ExceptionGotThrown('H', 4, bag) &&
                ExceptionGotThrown('I', 1, bag) &&
                ExceptionGotThrown('J', 8, bag) &&
                ExceptionGotThrown('K', 5, bag) &&
                ExceptionGotThrown('L', 1, bag) &&
                ExceptionGotThrown('M', 3, bag) &&
                ExceptionGotThrown('N', 1, bag) &&
                ExceptionGotThrown('O', 1, bag) &&
                ExceptionGotThrown('P', 3, bag) &&
                ExceptionGotThrown('Q', 10, bag) &&
                ExceptionGotThrown('R', 1, bag) &&
                ExceptionGotThrown('S', 1, bag) &&
                ExceptionGotThrown('T', 1, bag) &&
                ExceptionGotThrown('U', 1, bag) &&
                ExceptionGotThrown('V', 4, bag) &&
                ExceptionGotThrown('W', 4, bag) &&
                ExceptionGotThrown('X', 8, bag) &&
                ExceptionGotThrown('Y', 4, bag) &&
                ExceptionGotThrown('Z', 10, bag)
            );

            // Empty the bag
            for(int i = 0; i < bag.LetterTileCount;)
            {
                bag.DrawLetterTile();
            }

            // Make sure that at least one tile of every type can be added to the bag.
            Assert.IsFalse(
                ExceptionGotThrown(' ', 0, bag) &&
                ExceptionGotThrown('A', 1, bag) &&
                ExceptionGotThrown('B', 3, bag) &&
                ExceptionGotThrown('C', 3, bag) &&
                ExceptionGotThrown('D', 2, bag) &&
                ExceptionGotThrown('E', 1, bag) &&
                ExceptionGotThrown('F', 4, bag) &&
                ExceptionGotThrown('G', 2, bag) &&
                ExceptionGotThrown('H', 4, bag) &&
                ExceptionGotThrown('I', 1, bag) &&
                ExceptionGotThrown('J', 8, bag) &&
                ExceptionGotThrown('K', 5, bag) &&
                ExceptionGotThrown('L', 1, bag) &&
                ExceptionGotThrown('M', 3, bag) &&
                ExceptionGotThrown('N', 1, bag) &&
                ExceptionGotThrown('O', 1, bag) &&
                ExceptionGotThrown('P', 3, bag) &&
                ExceptionGotThrown('Q', 10, bag) &&
                ExceptionGotThrown('R', 1, bag) &&
                ExceptionGotThrown('S', 1, bag) &&
                ExceptionGotThrown('T', 1, bag) &&
                ExceptionGotThrown('U', 1, bag) &&
                ExceptionGotThrown('V', 4, bag) &&
                ExceptionGotThrown('W', 4, bag) &&
                ExceptionGotThrown('X', 8, bag) &&
                ExceptionGotThrown('Y', 4, bag) &&
                ExceptionGotThrown('Z', 10, bag)
            );

            // Empty the bag again.
            for (int i = 0; i < bag.LetterTileCount;)
            {
                bag.DrawLetterTile();
            }

            // Make sure LetterTiles can be added with the correct point values.
            Assert.IsFalse(ExceptionGotThrown(' ', 0, bag));
            Assert.IsFalse(ExceptionGotThrown('A', 1, bag));
            Assert.IsFalse(ExceptionGotThrown('B', 3, bag));
            Assert.IsFalse(ExceptionGotThrown('C', 3, bag));
            Assert.IsFalse(ExceptionGotThrown('D', 2, bag));
            Assert.IsFalse(ExceptionGotThrown('E', 1, bag));
            Assert.IsFalse(ExceptionGotThrown('F', 4, bag));
            Assert.IsFalse(ExceptionGotThrown('G', 2, bag));
            Assert.IsFalse(ExceptionGotThrown('H', 4, bag));
            Assert.IsFalse(ExceptionGotThrown('I', 1, bag));
            Assert.IsFalse(ExceptionGotThrown('J', 8, bag));
            Assert.IsFalse(ExceptionGotThrown('K', 5, bag));
            Assert.IsFalse(ExceptionGotThrown('L', 1, bag));
            Assert.IsFalse(ExceptionGotThrown('M', 3, bag));
            Assert.IsFalse(ExceptionGotThrown('N', 1, bag));
            Assert.IsFalse(ExceptionGotThrown('O', 1, bag));
            Assert.IsFalse(ExceptionGotThrown('P', 3, bag));
            Assert.IsFalse(ExceptionGotThrown('Q', 10, bag));
            Assert.IsFalse(ExceptionGotThrown('R', 1, bag));
            Assert.IsFalse(ExceptionGotThrown('S', 1, bag));
            Assert.IsFalse(ExceptionGotThrown('T', 1, bag));
            Assert.IsFalse(ExceptionGotThrown('U', 1, bag));
            Assert.IsFalse(ExceptionGotThrown('V', 4, bag));
            Assert.IsFalse(ExceptionGotThrown('W', 4, bag));
            Assert.IsFalse(ExceptionGotThrown('X', 8, bag));
            Assert.IsFalse(ExceptionGotThrown('Y', 4, bag));
            Assert.IsFalse(ExceptionGotThrown('Z', 10, bag));

            // Empty the bag again.
            for (int i = 0; i < bag.LetterTileCount;)
            {
                bag.DrawLetterTile();
            }

            // Make sure LetterTiles with incorrect point values cannot be inserted.
            Assert.IsTrue(ExceptionGotThrown(' ', 0 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('A', 1 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('B', 3 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('C', 3 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('D', 2 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('E', 1 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('F', 4 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('G', 2 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('H', 4 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('I', 1 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('J', 8 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('K', 5 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('L', 1 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('M', 3 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('N', 1 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('O', 1 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('P', 3 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('Q', 10 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('R', 1 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('S', 1 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('T', 1 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('U', 1 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('V', 4 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('W', 4 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('X', 8 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('Y', 4 + 1, bag));
            Assert.IsTrue(ExceptionGotThrown('Z', 10 + 1, bag));

            // Empty the bag yet again . . .
            for (int i = 0; i < bag.LetterTileCount;)
            {
                bag.DrawLetterTile();
            }

            // Just in case . . .
            Assert.IsTrue(bag.LetterTileCount == 0);

            // Make sure that the correct maximum amount of each type of LetterTile can be added to the bag.
            try
            {
                for (int i = 0; i < 2; ++i)
                {
                    bag.InsertLetterTile(new LetterTile(' ', 0));
                }
                for (int i = 0; i < 9; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('A', 1));
                }
                for (int i = 0; i < 2; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('B', 3));
                }
                for (int i = 0; i < 2; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('C', 3));
                }
                for (int i = 0; i < 4; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('D', 2));
                }
                for (int i = 0; i < 12; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('E', 1));
                }
                for (int i = 0; i < 2; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('F', 4));
                }
                for (int i = 0; i < 2; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('G', 2));
                }
                for (int i = 0; i < 2; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('H', 4));
                }
                for (int i = 0; i < 9; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('I', 1));
                }
                for (int i = 0; i < 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('J', 8));
                }
                for (int i = 0; i < 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('K', 5));
                }
                for (int i = 0; i < 4; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('L', 1));
                }
                for (int i = 0; i < 2; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('M', 3));
                }
                for (int i = 0; i < 6; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('N', 1));
                }
                for (int i = 0; i < 8; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('O', 1));
                }
                for (int i = 0; i < 2; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('P', 3));
                }
                for (int i = 0; i < 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('Q', 10));
                }
                for (int i = 0; i < 6; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('R', 1));
                }
                for (int i = 0; i < 4; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('S', 1));
                }
                for (int i = 0; i < 6; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('T', 1));
                }
                for (int i = 0; i < 4; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('U', 1));
                }
                for (int i = 0; i < 2; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('V', 4));
                }
                for (int i = 0; i < 2; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('W', 4));
                }
                for (int i = 0; i < 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('X', 8));
                }
                for (int i = 0; i < 2; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('Y', 4));
                }
                for (int i = 0; i < 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('Z', 10));
                }
            }
            catch
            {
                Assert.Fail();
            }

            // Now make sure that adding more than that amount throws an exception.
            bool exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 2+1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile(' ', 0));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try {
                for (int i = 0; i < 9 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('A', 1));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 2 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('B', 3));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try {
                for (int i = 0; i < 2 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('C', 3));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try {
                for (int i = 0; i < 4 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('D', 2));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try {
                for (int i = 0; i < 12 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('E', 1));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 2 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('F', 4));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try {
                for (int i = 0; i < 2 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('G', 2));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 2 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('H', 4));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 9 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('I', 1));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 1 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('J', 8));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 1 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('K', 5));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 4 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('L', 1));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 2 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('M', 3));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 6 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('N', 1));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 8 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('O', 1));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 2 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('P', 3));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 1 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('Q', 10));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 6 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('R', 1));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 4 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('S', 1));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 6 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('T', 1));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 4 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('U', 1));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 2 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('V', 4));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 2 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('W', 4));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 1 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('X', 8));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 2 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('Y', 4));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            try
            {
                for (int i = 0; i < 1 + 1; ++i)
                {
                    bag.InsertLetterTile(new LetterTile('Z', 10));
                }
            }
            catch
            {
                exceptionWasThrown = true;
            }
            Assert.IsTrue(exceptionWasThrown);
            exceptionWasThrown = false;

            // That was a disgusting amount of copy/paste . . .
        }
コード例 #6
0
        public void GameStateTest()
        {
            // should be able to create empty game state
            GameState emptyGameState = new GameState();

            var user1 = new Scrabble.PlayerClass.Player(1, "user1");
            emptyGameState.AddPlayer(user1);

            this.AssertPlayerEqual(emptyGameState.PlayerList[0], user1);

            // set up
            Board board = new Board();
            List<Scrabble.PlayerClass.Player> playerList = new List<Scrabble.PlayerClass.Player>();
            Bag tileBag = new Bag();

            var letterTileA = new LetterTile('A', 1);
            var letterTileN = new LetterTile('N', 1);
            var letterTileT = new LetterTile('T', 1);
            var letterTileS = new LetterTile('S', 1);
            List<LetterTile> word = new List<LetterTile> { letterTileA, letterTileN, letterTileT, letterTileS };
            var coordsX = new List<int>() { 6, 7, 8, 9 };
            var coordsY = new List<int>() { 7, 7, 7, 7 };
            Play recentPlay = new Play(word, coordsX, coordsY, 42);

            try
            {
                board.AddPlayToBoard(recentPlay);
            }
            catch (Exception err)
            {
                Assert.Fail();
            }

            for (int i = 1; i <= 3; ++i)
            {
                playerList.Add(new Scrabble.PlayerClass.Player(i, "user" + i));
                playerList[i - 1].AddToScore(i * 10);
            }

            playerList[2].IncrementSkipCount();
            playerList[1].ToggleVote();

            TurnOrder playerOrder = new TurnOrder(playerList);

            GameState gameState = new GameState(board, playerList, tileBag, playerOrder, recentPlay);

            playerList.Add(new Scrabble.PlayerClass.Player(4, "user" + 4));
            playerList[3].AddToScore(4 * 10);

            gameState.AddPlayer(playerList[3]);

            var player5 = new Scrabble.PlayerClass.Player(5, "user" + 5);
            player5.AddToScore(5 * 10);

            gameState.AddPlayer(player5);

            Assert.IsTrue(gameState.PlayerList.Count == 4);

            for (int i = 0; i < playerList.Count; ++i)
            {
                this.AssertPlayerEqual(gameState.PlayerList[i], playerList[i]);
            }

            Assert.IsTrue(board.Equals(gameState.GameBoard));
            Assert.IsTrue(tileBag.Equals(gameState.TileBag));
            Assert.IsTrue(playerOrder.Equals(gameState.PlayerOrder));
            Assert.IsTrue(recentPlay.Equals(gameState.RecentPlay));
        }