Esempio n. 1
0
        public void ShapeI_Reset()
        {
            Board  board              = new Board();
            ShapeL shapeTest          = new ShapeL(board);
            ShapeL shapeTest_expected = new ShapeL(board);
            String expected           = "(5, 0)(6, 0)(4, 0)(4, 1)";

            //Act

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

            shapeTest.Reset();


            //Assert
            Assert.AreEqual(expected, shapeTest.getPositionOfBlocks());
        }
Esempio n. 2
0
        public void ShapeL_Rotate1_EnoughSpace()
        {
            //Initial position = a(5,0)b(6,0)c(4,0)d(4,1)
            //Move down = a(5,1)b(6,1)c(4,1)d(4,2)
            Board  board              = new Board();
            ShapeL shapeTest          = new ShapeL(board);
            ShapeL shapeTest_expected = new ShapeL(board);
            String expected           = "(5, 1)(5, 0)(5, 2)(6, 2)";

            //Act
            shapeTest.MoveDown();


            shapeTest.Rotate();

            //Assert
            Assert.AreEqual(expected, shapeTest.getPositionOfBlocks());
        }
Esempio n. 3
0
        public void ShapeL_Rotate2_EnoughSpace()
        {
            //a(5, 1)b(5, 2)c(5, 0)d(4, 0)

            Board  board              = new Board();
            ShapeL shapeTest          = new ShapeL(board);
            ShapeL shapeTest_expected = new ShapeL(board);
            String expected           = "(5, 1)(4, 1)(6, 1)(6, 0)";


            //Act
            shapeTest.MoveDown();
            shapeTest.Rotate();
            shapeTest.Rotate();


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