use of org.wikipedia.page.PageProperties in project apps-android-wikipedia by wikimedia.
the class DescriptionEditClientTest method testIsEditAllowedSuccess.
@Test
public void testIsEditAllowedSuccess() {
WikiSite wiki = WikiSite.forLanguageCode("ru");
PageProperties props = mock(PageProperties.class);
when(props.getWikiBaseItem()).thenReturn("Q123");
when(props.canEdit()).thenReturn(true);
when(props.getDescriptionSource()).thenReturn("central");
Page page = new Page(new PageTitle("Test", wiki, null, null, props), Collections.<Section>emptyList(), props);
assertThat(DescriptionEditUtil.isEditAllowed(page), is(true));
}
use of org.wikipedia.page.PageProperties in project apps-android-wikipedia by wikimedia.
the class DescriptionEditClientTest method testIsEditAllowedNoWikiBaseItem.
@Test
public void testIsEditAllowedNoWikiBaseItem() {
WikiSite wiki = WikiSite.forLanguageCode("ru");
PageProperties props = mock(PageProperties.class);
when(props.getWikiBaseItem()).thenReturn(null);
Page page = new Page(new PageTitle("Test", wiki, null, null, props), Collections.<Section>emptyList(), props);
assertThat(DescriptionEditUtil.isEditAllowed(page), is(false));
}
use of org.wikipedia.page.PageProperties in project apps-android-wikipedia by wikimedia.
the class ShareHandler method createFunnel.
private void createFunnel() {
WikipediaApp app = WikipediaApp.getInstance();
final Page page = fragment.getPage();
final PageProperties pageProperties = page.getPageProperties();
funnel = new ShareAFactFunnel(app, page.getTitle(), pageProperties.getPageId(), pageProperties.getRevisionId());
}
use of org.wikipedia.page.PageProperties in project apps-android-wikipedia by wikimedia.
the class ParcelableTest method testPageProperties.
@Test
public void testPageProperties() throws Throwable {
WikiSite wiki = WikiSite.forLanguageCode("en");
PageTitle title = new PageTitle("Talk", "India", wiki);
PageProperties props = new PageProperties(title, false);
TestParcelUtil.test(props);
}
Aggregations