Skip to content

Commit

Permalink
Fix MainActivity tests by adding GDG prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
tasomaniac committed Dec 24, 2016
1 parent fedd765 commit 18b3a87
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

@RunWith(AndroidJUnit4.class)
public class MainActivityTest {
private static final Chapter CHAPTER_ISTANBUL = new Chapter("Istanbul", "100514812580249787371");
private static final Chapter CHAPTER_BRUSSELS = new Chapter("Brussels", "105068877693379070381");
private static final Chapter CHAPTER_ISTANBUL = new Chapter("GDG Istanbul", "100514812580249787371");
private static final Chapter CHAPTER_BRUSSELS = new Chapter("GDG Brussels", "105068877693379070381");

@Rule
public ActivityTestRule<MainActivity> activityRule = new ActivityTestRule<MainActivity>(MainActivity.class) {
Expand All @@ -53,7 +53,7 @@ public void supportsChapterSwapping() {
onData(allOf(is(instanceOf(Chapter.class)), is(CHAPTER_ISTANBUL)))
.perform(click());
onViewChapterSwitcher()
.check(matches(withText(CHAPTER_ISTANBUL.toString())));
.check(matches(withText(CHAPTER_ISTANBUL.getName())));

onView(withId(R.id.pager)).perform(swipeRight());
onView(withId(R.id.tagline)).check(matches(withText(containsString(CHAPTER_ISTANBUL.toString()))));
Expand All @@ -69,11 +69,11 @@ public void keepsChapterOnOrientationChange() {
onViewChapterSwitcher().perform(click());
onData(allOf(is(instanceOf(Chapter.class)), is(CHAPTER_ISTANBUL)))
.perform(click());
onViewChapterSwitcher().check(matches(withText(CHAPTER_ISTANBUL.toString())));
onViewChapterSwitcher().check(matches(withText(CHAPTER_ISTANBUL.getName())));

onView(isRoot()).perform(orientationLandscape(activityRule.getActivity()));

onViewChapterSwitcher().check(matches(withText(CHAPTER_ISTANBUL.toString())));
onViewChapterSwitcher().check(matches(withText(CHAPTER_ISTANBUL.getName())));
}

private static ViewInteraction onViewChapterSwitcher() {
Expand Down

0 comments on commit 18b3a87

Please sign in to comment.