示例#1
0
  @Test
  public void lackOfKonvGroupSettings() {

    settings.shrinkKonvGroupScope(konvGroup);

    assertFalse(settings.hasKonvGroupSettings());
  }
示例#2
0
  @Test
  public void expandKonvScope() {

    settings.expandKonvScope(konv);

    assertTrue(settings.contains(konv));
  }
示例#3
0
  @Test
  public void shouldExpandDecreeSequenceGroupScope() {

    settings.expandDecreeSequenceGroupScope(group);

    assertTrue(settings.contains(group));
  }
示例#4
0
  @Test
  public void shrinkKonvScope() {
    settings.expandKonvScope(konv);

    settings.shrinkKonvScope(konv);

    assertFalse(settings.contains(konv));
  }
示例#5
0
  @Test
  public void shouldShrinkDecreeSequenceGroupScope() {

    settings.expandDecreeSequenceGroupScope(group);
    settings.shrinkDecreeSequenceGroupScope(group);

    assertFalse(settings.contains(group));
  }
示例#6
0
  @Test
  public void defineTheScopeOfReportInputParams() {

    List<DecreeSequence> decreeSequences = settings.getDecreeSequences();
    List<GeoArea> geoAreas = settings.getGeoAreas();
    List<KonvGroup> konvGroups = settings.getKonvGroups();

    assertThat(decreeSequences, hasItem(decreeSequence));
    assertThat(geoAreas, hasItem(geoArea));
    assertThat(konvGroups, hasItem(konvGroup));
  }
示例#7
0
  @Test
  public void shouldReturnInputKonvGroupListWhenAnEmptyKonvGroupScopeIsFound() {

    settings.shrinkKonvGroupScope(konvGroup);
    assertThat(settings.hasKonvGroupSettings(), is(Boolean.FALSE));

    final KonvGroup inputKonvGroup = mock(KonvGroup.class);

    List<KonvGroup> selected = settings.chooseOver(Arrays.asList(inputKonvGroup));

    assertThat(selected, hasItems(inputKonvGroup));
    assertThat(selected, not(hasItems(konvGroup)));
  }
示例#8
0
  @Test
  public void twoSettingsShouldBeEqualIfTheyShareSameCode() {

    ReportSettings other = new ReportSettings(settings.getCode());

    assertThat(other, is(equalTo(settings)));
  }
示例#9
0
  @Test
  public void shouldReturnNonEmptyKonvGroupScopeWhenChoosingOverAnEmptyListOfInputKonvGroups() {

    List<KonvGroup> selected = settings.chooseOver(Collections.EMPTY_LIST);

    assertThat(selected, hasItems(konvGroup));
    assertThat(selected.size(), is(1));
  }
示例#10
0
  @Test
  public void shouldReturnNonEmptyKonvGroupScopeWhenChoosingOverNonEmptyListOfInputKonvGroups() {
    final KonvGroup inputKonvGroup = mock(KonvGroup.class);

    List<KonvGroup> selected = settings.chooseOver(Arrays.asList(inputKonvGroup));

    assertThat(selected, hasItems(konvGroup));
    assertThat(selected, not(hasItems(inputKonvGroup)));
  }
示例#11
0
  @Test
  public void aReportSettingsShouldNotContainAkonvWhenItIsNotPresentInItsKonvsCollection()
      throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException {

    Field konvsField = ReportSettings.class.getDeclaredField("konvs");
    konvsField.setAccessible(true);
    final ArrayList<Konv> konvs = new ArrayList<>();
    konvsField.set(settings, konvs);

    assertFalse(settings.contains(konv));
  }
示例#12
0
  @Test
  public void shrinkReportSettingsScopes() {

    settings.shrinkDecreeSequenceScope(decreeSequence);
    settings.shrinkGeoAreaScope(geoArea);
    settings.shrinkKonvGroupScope(konvGroup);

    assertThat(settings.getDecreeSequences(), not(hasItem(decreeSequence)));
    assertThat(settings.getGeoAreas(), not(hasItem(geoArea)));
    assertThat(settings.getKonvGroups(), not(hasItem(konvGroup)));
  }
示例#13
0
  @Test
  public void hasKonvGroupSettings() {

    assertTrue(settings.hasKonvGroupSettings());
  }