Exemplo n.º 1
0
        public void TestMoveRight()
        {
            var shape = new ShapeZ(new Point(2, 3));
            shape.MoveRight();

            Assert.AreEqual(3, shape.Tiles[0].Position.X);
            Assert.AreEqual(4, shape.Tiles[1].Position.X);
            Assert.AreEqual(4, shape.Tiles[2].Position.X);
            Assert.AreEqual(5, shape.Tiles[3].Position.X);
        }
Exemplo n.º 2
0
        //test with shapeZ to verify multi-line shapes
        public void MoveRight_NoSpace_EmptyBoard()
        {
            //arange
            IBoard board = new TestBoard(createEmptyBoard(8, 10));
            IShape shape = new ShapeZ(board);

            //act
            shape.MoveRight();
            int x = shape[0].Position.X;
            int y = shape[0].Position.Y;

            //assert
            Assert.AreEqual(5, x);             //expected, actual
            Assert.AreEqual(0, y);
        }
Exemplo n.º 3
0
        //test with shapeZ to verify multi-line shapes
        public void MoveRight_NoSpace_BoardWithLine()
        {
            //arange
            IBoard board = new TestBoard
                               (createBoardWithLineVert(8, -1, (i => i >= 0)));
            IShape shape = new ShapeZ(board);

            //act
            shape.MoveRight();
            int x = shape[0].Position.X;
            int y = shape[0].Position.Y;

            //assert
            Assert.AreEqual(5, x);             //expected, actual
            Assert.AreEqual(0, y);
        }