Esempio n. 1
0
        public void ShapeJ_Reset()
        {
            Board  board              = new Board();
            ShapeJ shapeTest          = new ShapeJ(board);
            ShapeJ shapeTest_expected = new ShapeJ(board);
            String expected           = "(5, 0)(6, 0)(4, 0)(6, 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 ShapeJ_Rotate1_EnoughSpace()
        {
            //Initial position = a(5, 0)b(6, 0)c(4, 0)d(6, 1)
            //Move down = a(5, 1)b(6, 1)c(4, 1)d(6, 2)
            Board  board              = new Board();
            ShapeJ shapeTest          = new ShapeJ(board);
            ShapeJ shapeTest_expected = new ShapeJ(board);
            String expected           = "(5, 1)(5, 2)(5, 0)(4, 2)";

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

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

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


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


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