package org.wikipedia.test;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.history.HistoryEntry;
import org.wikipedia.page.PageProperties;
import org.wikipedia.page.PageTitle;
import org.wikipedia.pageimages.PageImage;

@RunWith(RobolectricTestRunner.class) public class ParcelableTest {
    @Test public void testPageTitle() throws Throwable {
        PageTitle title = new PageTitle(null, "Test", WikiSite.forLanguageCode("en"));
        TestParcelUtil.test(title);
    }

    @Test public void testPageTitleTalk() throws Throwable {
        WikiSite wiki = WikiSite.forLanguageCode("en");
        PageTitle origTitle = new PageTitle("Talk", "India", wiki);
        TestParcelUtil.test(origTitle);
    }

    @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);
    }

    @Test public void testHistoryEntry() throws Throwable {
        WikiSite wiki = WikiSite.forLanguageCode("en");
        PageTitle title = new PageTitle("Talk", "India", wiki);
        HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_EXTERNAL_LINK);

        TestParcelUtil.test(historyEntry);
    }

    @Test public void testPageImage() throws Throwable {
        WikiSite wiki = WikiSite.forLanguageCode("en");
        PageTitle title = new PageTitle("Talk", "India", wiki);
        PageImage pageImage = new PageImage(title, "Testing image");

        TestParcelUtil.test(pageImage);
    }
}

@@ -291,51 +291,8 @@
 tle;
-%0Aimport org.wikipedia.pageimages.PageImage;
 %0A%0A@R
@@ -1395,301 +1395,7 @@
    %7D
-%0A%0A    @Test public void testPageImage() throws Throwable %7B%0A        WikiSite wiki = WikiSite.forLanguageCode(%22en%22);%0A        PageTitle title = new PageTitle(%22Talk%22, %22India%22, wiki);%0A        PageImage pageImage = new PageImage(title, %22Testing image%22);%0A%0A        TestParcelUtil.test(pageImage);%0A    %7D
 %0A%7D%0A

Remove parcelable test