Пример #1
0
        public void ShapeI_Reset()
        {
            Board  board              = new Board();
            ShapeI shapeTest          = new ShapeI(board);
            ShapeI shapeTest_expected = new ShapeI(board);
            String expected           = "(5, 0)(6, 0)(4, 0)(3, 0)";

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

            //Act

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

            /*     Position after moving
             *
             * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
             * [ ][ ][b][ ][ ][ ][ ][ ][ ][ ]
             * [ ][ ][a][ ][ ][ ][ ][ ][ ][ ]
             * [ ][ ][c][ ][ ][ ][ ][ ][ ][ ]
             * [ ][ ][d][ ][ ][ ][ ][ ][ ][ ]
             * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
             *
             */

            shapeTest.Reset();


            /*     Should be back to original position
             *
             * [ ][ ][ ][d][c][a][b][ ][ ][ ]
             * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
             * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
             * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
             *
             */

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