コード例 #1
0
 @Test
 public void areContoursDisjoint_should_return_false_when_not_all_shared_zones_are_shaded() {
   Set<Zone> present = new HashSet<>();
   present.add(Zone.fromOutContours("A", "B", "C", "D"));
   ContourRelations contourRelations =
       new ContourRelations(
           SpiderDiagrams.createPrimarySD(
               null, null, getZonesInsideAllContours(POWER_REGION_ABCD, "A", "B", "C"), present));
   assertFalse(contourRelations.areContoursDisjoint("A", "D"));
 }
コード例 #2
0
 @Test
 public void
     areContoursDisjoint_should_return_true_when_the_spiders_are_not_in_the_shared_shaded_zones() {
   TreeMap<String, Region> habitats = new TreeMap<>();
   String spider = "s";
   habitats.put(spider, new Region(Zone.fromInContours("A", "C").withOutContours("B", "D")));
   Set<Zone> present = new HashSet<>();
   present.add(Zone.fromOutContours("A", "B", "C", "D"));
   PrimarySpiderDiagram diagramWithASpiderInTheIntersection =
       SpiderDiagrams.createPrimarySD(
           asList(spider),
           habitats,
           getZonesInsideAllContours(POWER_REGION_ABCD, "A", "D"),
           present);
   ContourRelations contourRelations = new ContourRelations(diagramWithASpiderInTheIntersection);
   assertTrue(contourRelations.areContoursDisjoint("A", "D"));
 }
コード例 #3
0
 @Test
 public void areContoursDisjoint_should_return_true_when_zone_AsubB_is_shaded() {
   ContourRelations contourRelations = new ContourRelations(diagramWithShadedIntersection);
   assertTrue(contourRelations.areContoursDisjoint("A", "B"));
 }
コード例 #4
0
 @Test
 public void areContoursDisjoint_should_return_false_in_a_Venn_diagram() {
   ContourRelations contourRelations = new ContourRelations(diagramWithContoursAB);
   assertFalse(contourRelations.areContoursDisjoint("A", "B"));
 }