public void L_Should_South() { var lShape = new LShapedPiece(); lShape.Turn(); lShape.Turn(); var exptected = PieceOrientation.South; var actual = lShape.Orientation; Assert.AreEqual(exptected, actual); }
public void L_Should_TurnRight() { var lShape = new LShapedPiece(); var collisionMapList = lShape.DecomposeCollisionMapInLinesOfBlocks(); lShape.Turn(); var turnedCollisionMapList = lShape.DecomposeCollisionMapInLinesOfBlocks(); var first = collisionMapList.First().Last(); var firstTurned = turnedCollisionMapList.Last().Last(); Assert.AreEqual(first, firstTurned); var second = collisionMapList[1].Last(); var secondTurned = turnedCollisionMapList[1][1]; Assert.AreEqual(second, secondTurned); }
public void L_Should_DoubleTurn() { var lShape = new LShapedPiece(); var collisionMapList = lShape.DecomposeCollisionMapInLinesOfBlocks(); lShape.Turn(); lShape.Turn(); var turnedCollisionMapList = lShape.DecomposeCollisionMapInLinesOfBlocks(); var expected = collisionMapList[0][1]; var actual = turnedCollisionMapList[1][0]; Assert.AreEqual(expected, actual); var expected1 = collisionMapList[1][1]; var actual1 = turnedCollisionMapList[2][0]; Assert.AreEqual(expected1, actual1); }
public void LShaped_Should_Be_Four_Contiguous_Blocks() { var lShapedPiece = new LShapedPiece(); Assert.IsTrue(lShapedPiece.IsFourContiguousBlocks); }