Beispiel #1
0
        public void ShapeJ_Rotate_NoSpace()
        {
            //Initial position = a(5,0)b(6,0)c(4,0)d(4,1)
            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.Rotate();

            //Assert
            Assert.AreEqual(expected, shapeTest.getPositionOfBlocks());
        }
Beispiel #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());
        }
Beispiel #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());
        }
Beispiel #4
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());
        }