public void TestShapeT_InvalidRotate() { //arrange IBoard board = new Board(); ShapeT shape = new ShapeT(board); //act shape.Rotate(); // Assert Assert.AreEqual(new Point(4, 0), shape[0].Position); Assert.AreEqual(new Point(5, 0), shape[1].Position); Assert.AreEqual(new Point(5, 1), shape[2].Position); Assert.AreEqual(new Point(6, 0), shape[3].Position); }
public void TestShapeT_DownRotateDrop() { //arrange IBoard board = new Board(); ShapeT shape = new ShapeT(board); //act shape.MoveDown(); shape.Rotate(); shape.Drop(); //assert Assert.AreEqual(new Point(5, 19), shape[0].Position); Assert.AreEqual(new Point(5, 18), shape[1].Position); Assert.AreEqual(new Point(6, 18), shape[2].Position); Assert.AreEqual(new Point(5, 17), shape[3].Position); }
public void TestShapeT_DownRotateRight() { //arrange IBoard board = new Board(); ShapeT shape = new ShapeT(board); //act shape.MoveDown(); shape.Rotate(); shape.MoveLeft(); //assert Assert.AreEqual(new Point(4, 2), shape[0].Position); Assert.AreEqual(new Point(4, 1), shape[1].Position); Assert.AreEqual(new Point(5, 1), shape[2].Position); Assert.AreEqual(new Point(4, 0), shape[3].Position); }
public void TestMethodShapeT_Rotate4() { //arrange IBoard board = new Board(); ShapeT shape = new ShapeT(board); //act shape.MoveDown(); shape.Rotate(); shape.Rotate(); shape.Rotate(); shape.Rotate(); //assert Assert.AreEqual(4, shape[0].Position.X); Assert.AreEqual(1, shape[0].Position.Y); Assert.AreEqual(5, shape[1].Position.X); Assert.AreEqual(1, shape[1].Position.Y); Assert.AreEqual(5, shape[2].Position.X); Assert.AreEqual(2, shape[2].Position.Y); Assert.AreEqual(6, shape[3].Position.X); Assert.AreEqual(1, shape[3].Position.Y); }