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); }
//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); }
//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); }