public void RectanglesWithSimpleIntersections() { AreEqual(5, TotalAreaCoveredByRectangles.Calculate(new[] { new[] { 1, 4, 2, 7 }, new[] { 1, 4, 2, 6 }, new[] { 1, 4, 4, 5 } })); }
public void RectanglesWithSimpleIntersections2() { AreEqual(1, TotalAreaCoveredByRectangles.Calculate(new[] { new[] { 1, 1, 2, 2 }, new[] { 1, 1, 2, 2 }, new[] { 1, 1, 2, 2 } })); }
public void RectanglesWithSimpleIntersections1() { AreEqual(21, TotalAreaCoveredByRectangles.Calculate(new[] { new[] { 1, 1, 2, 2 }, new[] { 1, 4, 2, 7 }, new[] { 1, 4, 2, 6 }, new[] { 1, 4, 4, 5 }, new[] { 2, 5, 6, 7 }, new[] { 4, 3, 7, 6 } })); }
public void ThreeRectangles() { AreEqual(36, TotalAreaCoveredByRectangles.Calculate(new[] { new[] { 3, 3, 8, 5 }, new[] { 6, 3, 8, 9 }, new[] { 11, 6, 14, 12 } })); }
public void TwoRectanglesV2() { AreEqual(4, TotalAreaCoveredByRectangles.Calculate(new[] { new[] { 0, 0, 1, 1 }, new[] { 0, 0, 2, 2 } })); }
public void OneRectangleV2() { AreEqual(22, TotalAreaCoveredByRectangles.Calculate(new[] { new[] { 0, 4, 11, 6 } })); }
public void OneRectangle() { AreEqual(1, TotalAreaCoveredByRectangles.Calculate(new[] { new[] { 0, 0, 1, 1 } })); }
public void ZeroRectangles() { AreEqual(0, TotalAreaCoveredByRectangles.Calculate(Enumerable.Empty <int[]>())); }