Пример #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"));
 }