public void ShapeT_Rotate_NoSpace() { IBoard board = new Board(); ShapeT shapeTest = new ShapeT(board); ShapeT shapeTest_expected = new ShapeT(board); String expected = "(5, 0)(6, 0)(4, 0)(5, 1)"; /* first row of the board * Initial position * * [ ][ ][ ][ ][c][a][b][ ][ ][ ] * [ ][ ][ ][ ][ ][d][ ][ ][ ][ ] */ //act shapeTest.Rotate(); /* Should look like this after attempting to rotate * [ ][ ][ ][ ][c][a][b][ ][ ][ ] * [ ][ ][ ][ ][ ][d][ ][ ][ ][ ] * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ] * */ //Assert Assert.AreEqual(expected, shapeTest.getPositionOfBlocks()); }
public void ShapeT_Reset() { IBoard board = new Board(); ShapeT shapeTest = new ShapeT(board); ShapeT shapeTest_expected = new ShapeT(board); String expected = "(5, 0)(6, 0)(4, 0)(5, 1)"; /* first row of the board * Initial position * * [ ][ ][ ][ ][c][a][b][ ][ ][ ] * [ ][ ][ ][ ][ ][d][ ][ ][ ][ ] */ //Act shapeTest.MoveDown(); shapeTest.MoveDown(); shapeTest.MoveLeft(); shapeTest.MoveLeft(); shapeTest.MoveLeft(); shapeTest.Rotate(); /* Should look like this after reset. * [ ][ ][ ][ ][c][a][b][ ][ ][ ] * [ ][ ][ ][ ][ ][d][ ][ ][ ][ ] * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ] * */ shapeTest.Reset(); //Assert Assert.AreEqual(expected, shapeTest.getPositionOfBlocks()); }
public void ShapeT_Rotate4_EnoughSpace() { IBoard board = new Board(); ShapeT shapeTest = new ShapeT(board); ShapeT shapeTest_expected = new ShapeT(board); String expected = "(5, 1)(6, 1)(4, 1)(5, 2)"; /* first row of the board * Initial position * * [ ][ ][ ][ ][c][a][b][ ][ ][ ] * [ ][ ][ ][ ][ ][d][ ][ ][ ][ ] */ //Act shapeTest.MoveDown(); /* AFter moving down to allow space to rotate * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ] * [ ][ ][ ][ ][c][a][b][ ][ ][ ] * [ ][ ][ ][ ][ ][d][ ][ ][ ][ ] * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ] */ shapeTest.Rotate(); shapeTest.Rotate(); shapeTest.Rotate(); shapeTest.Rotate(); /* Should look like this after rotating twice. * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ] * [ ][ ][ ][ ][c][a][b][ ][ ][ ] * [ ][ ][ ][ ][ ][d][ ][ ][ ][ ] * [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ] * */ //Assert Assert.AreEqual(expected, shapeTest.getPositionOfBlocks()); }