public void ShapeT_MoveRight_NoSpace() { IBoard board = new Board(); ShapeT shapeTest = new ShapeT(board); ShapeT shapeTest_expected = new ShapeT(board); String expected = "(8, 0)(9, 0)(7, 0)(8, 1)"; /* First row of the board * Initial position * * [ ][ ][ ][ ][c][a][b][ ][ ][ ] * [ ][ ][ ][ ][ ][d][ ][ ][ ][ ] * */ shapeTest.MoveRight(); shapeTest.MoveRight(); shapeTest.MoveRight(); shapeTest.MoveRight(); /* Moved to the border. * * [ ][ ][ ][ ][ ][ ][ ][c][a][b] * [ ][ ][ ][ ][ ][ ][ ][ ][d][ ] * */ //Now move once more to check if it goes outside the board shapeTest.MoveRight(); Assert.AreEqual(expected, shapeTest.getPositionOfBlocks()); }
public void ShapeT_MoveRight_EnoughSpace() { IBoard board = new Board(); ShapeT shapeTest = new ShapeT(board); ShapeT shapeTest_expected = new ShapeT(board); String expected = "(6, 0)(7, 0)(5, 0)(6, 1)"; /* First row of the board * Initial position * * [ ][ ][ ][ ][c][a][b][ ][ ][ ] * [ ][ ][ ][ ][ ][d][ ][ ][ ][ ] * */ shapeTest.MoveRight(); /* * [ ][ ][ ][ ][ ][c][a][b][ ][ ] * [ ][ ][ ][ ][ ][ ][d][ ][ ][ ] * */ Assert.AreEqual(expected, shapeTest.getPositionOfBlocks()); }
public void TestMoveRight() { var shape = new ShapeT(new Point(2, 3)); shape.MoveRight(); Assert.AreEqual(4, shape.Tiles[0].Position.X); Assert.AreEqual(4, shape.Tiles[1].Position.X); Assert.AreEqual(4, shape.Tiles[2].Position.X); Assert.AreEqual(3, shape.Tiles[3].Position.X); }