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