Example #1
0
        public void ShapeZ_Reset()
        {
            IBoard board              = new Board();
            ShapeZ shapeTest          = new ShapeZ(board);
            ShapeZ shapeTest_expected = new ShapeZ(board);
            String expected           = "(5, 0)(4, 0)(5, 1)(6, 1)";

            /*      first row of the board
             *          Initial position
             *
             * [ ][ ][ ][ ][b][a][ ][ ][ ][ ]
             * [ ][ ][ ][ ][ ][c][d][ ][ ][ ]
             * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
             * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
             */

            //Act

            shapeTest.MoveDown();
            shapeTest.MoveDown();
            shapeTest.MoveLeft();
            shapeTest.MoveLeft();
            shapeTest.MoveLeft();
            shapeTest.Rotate();

            /*     Should look like this after reset.
             * [ ][ ][ ][ ][b][a][ ][ ][ ][ ]
             * [ ][ ][ ][ ][ ][c][d][ ][ ][ ]
             * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
             * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
             */

            shapeTest.Reset();
            //Assert
            Assert.AreEqual(expected, shapeTest.getPositionOfBlocks());
        }