示例#1
0
  @Test
  public void should_get_pages_by_section() {
    final Views views = new Views(VIEWS);

    List<ViewProxy<Page>> pages = views.getPages(NavigationSection.RESOURCE);
    assertThat(pages.size()).isEqualTo(1);
    assertThat(pages.get(0).getTarget().getClass()).isEqualTo(FakePage.class);

    pages = views.getPages(NavigationSection.CONFIGURATION);
    assertThat(pages.size()).isEqualTo(0);
  }
示例#2
0
  @Test
  public void getPagesBySection() {
    final Views views = new Views(VIEWS);

    List<ViewProxy<Page>> pages = views.getPages(NavigationSection.RESOURCE);
    assertThat(pages.size(), is(1));
    assertThat(pages.get(0).getTarget(), is(FakePage.class));

    pages = views.getPages(NavigationSection.CONFIGURATION);
    assertThat(pages.size(), is(0));
  }
示例#3
0
 @Test
 public void getResourceViewers() {
   final Views views = new Views(VIEWS);
   List resourceViewers = views.getPages(NavigationSection.RESOURCE_TAB);
   assertThat(resourceViewers.size(), is(1 + 4 /* default */));
   assertThat(resourceViewers.contains(new ViewProxy((View) FAKE_TAB)), is(true));
 }
示例#4
0
 @Test
 public void should_get_resource_viewers() {
   final Views views = new Views(VIEWS);
   List resourceViewers = views.getPages(NavigationSection.RESOURCE_TAB);
   assertThat(resourceViewers.size()).isEqualTo(1 + 4 /* default */);
   assertThat(resourceViewers.contains(new ViewProxy<FakeResourceViewer>(FAKE_TAB)))
       .isEqualTo(true);
 }