コード例 #1
0
        public void TestMoveLeft()
        {
            var shape = new ShapeL(new Point(2, 3));
            shape.MoveLeft();

            Assert.AreEqual(3, shape.Tiles[0].Position.X);
            Assert.AreEqual(2, shape.Tiles[1].Position.X);
            Assert.AreEqual(1, shape.Tiles[2].Position.X);
            Assert.AreEqual(1, shape.Tiles[3].Position.X);
        }
コード例 #2
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());
        }