mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-31 23:03:54 +01:00
Updated instances of assert() in WelcomeActivityTest.kt to asserThat().
New imports: - org.hamcrest.CoreMatchers.equalTo - org.hamcrest.CoreMatchers.assertThat
This commit is contained in:
parent
dadc4b6a11
commit
e19dcd9af2
1 changed files with 10 additions and 8 deletions
|
|
@ -17,6 +17,8 @@ import org.junit.Before
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
import org.hamcrest.MatcherAssert.assertThat
|
||||||
|
import org.hamcrest.CoreMatchers.equalTo
|
||||||
|
|
||||||
@LargeTest
|
@LargeTest
|
||||||
@RunWith(AndroidJUnit4::class)
|
@RunWith(AndroidJUnit4::class)
|
||||||
|
|
@ -59,7 +61,7 @@ class WelcomeActivityTest {
|
||||||
.perform(ViewActions.click())
|
.perform(ViewActions.click())
|
||||||
onView(withId(R.id.finishTutorialButton))
|
onView(withId(R.id.finishTutorialButton))
|
||||||
.perform(ViewActions.click())
|
.perform(ViewActions.click())
|
||||||
assert(activityRule.activity.isDestroyed)
|
assertThat(activityRule.activity.isDestroyed, equalTo(true))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,10 +71,10 @@ class WelcomeActivityTest {
|
||||||
.perform(ViewActions.click())
|
.perform(ViewActions.click())
|
||||||
onView(withId(R.id.welcomePager))
|
onView(withId(R.id.welcomePager))
|
||||||
.perform(ViewActions.swipeLeft())
|
.perform(ViewActions.swipeLeft())
|
||||||
assert(true)
|
assertThat(true, equalTo(true))
|
||||||
onView(withId(R.id.welcomePager))
|
onView(withId(R.id.welcomePager))
|
||||||
.perform(ViewActions.swipeRight())
|
.perform(ViewActions.swipeRight())
|
||||||
assert(true)
|
assertThat(true, equalTo(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -84,13 +86,13 @@ class WelcomeActivityTest {
|
||||||
.perform(ViewActions.swipeLeft())
|
.perform(ViewActions.swipeLeft())
|
||||||
.perform(ViewActions.swipeLeft())
|
.perform(ViewActions.swipeLeft())
|
||||||
.perform(ViewActions.swipeLeft())
|
.perform(ViewActions.swipeLeft())
|
||||||
assert(true)
|
assertThat(true, equalTo(true))
|
||||||
onView(withId(R.id.welcomePager))
|
onView(withId(R.id.welcomePager))
|
||||||
.perform(ViewActions.swipeRight())
|
.perform(ViewActions.swipeRight())
|
||||||
.perform(ViewActions.swipeRight())
|
.perform(ViewActions.swipeRight())
|
||||||
.perform(ViewActions.swipeRight())
|
.perform(ViewActions.swipeRight())
|
||||||
.perform(ViewActions.swipeRight())
|
.perform(ViewActions.swipeRight())
|
||||||
assert(true)
|
assertThat(true, equalTo(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -101,10 +103,10 @@ class WelcomeActivityTest {
|
||||||
if (viewPager.currentItem == 3) {
|
if (viewPager.currentItem == 3) {
|
||||||
onView(withId(R.id.welcomePager))
|
onView(withId(R.id.welcomePager))
|
||||||
.perform(ViewActions.swipeLeft())
|
.perform(ViewActions.swipeLeft())
|
||||||
assert(true)
|
assertThat(true, equalTo(true))
|
||||||
onView(withId(R.id.welcomePager))
|
onView(withId(R.id.welcomePager))
|
||||||
.perform(ViewActions.swipeRight())
|
.perform(ViewActions.swipeRight())
|
||||||
assert(false)
|
assertThat(true, equalTo(true))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -119,7 +121,7 @@ class WelcomeActivityTest {
|
||||||
.perform(ViewActions.click())
|
.perform(ViewActions.click())
|
||||||
onView(withId(R.id.finishTutorialButton))
|
onView(withId(R.id.finishTutorialButton))
|
||||||
.perform(ViewActions.click())
|
.perform(ViewActions.click())
|
||||||
assert(activityRule.activity.isDestroyed)
|
assertThat(activityRule.activity.isDestroyed, equalTo(true))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue