Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
klinker24 committed Jul 22, 2022
1 parent 82ec444 commit b673081
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ class TutorialPresenterTest : FloatingTutorialJunitSuite() {
fun shouldRevealOnStart() {
val mockPage = mock(TutorialPage::class.java)

doNothing().`when`(presenter!!).circularRevealIn()
doNothing().`when`(presenter!!).revealIn()
doReturn(mockPage).`when`(provider!!).currentPage()

presenter!!.start()

verify(presenter!!).circularRevealIn()
verify(presenter!!).revealIn()
verify(mockPage).onShown(true)
}

Expand All @@ -71,12 +71,12 @@ class TutorialPresenterTest : FloatingTutorialJunitSuite() {

@Test
fun shouldExitWhenBackingOutOfTheFirstPage() {
doNothing().`when`(presenter!!).circularRevealOut()
doNothing().`when`(presenter!!).revealOut()

`when`(provider!!.previousPage()).thenReturn(null)
presenter!!.onBackPressed()

verify(presenter!!).circularRevealOut()
verify(presenter!!).revealOut()
}

@Test
Expand Down Expand Up @@ -119,20 +119,20 @@ class TutorialPresenterTest : FloatingTutorialJunitSuite() {

@Test
fun shouldExitWhenGoingForwardOnLastPage() {
doNothing().`when`(presenter!!).circularRevealOut()
doNothing().`when`(presenter!!).revealOut()

`when`(provider!!.nextPage()).thenReturn(null)
presenter!!.onNextPressed()

verify(presenter!!).circularRevealOut()
verify(presenter!!).revealOut()
}

@Test
fun shouldProvideFinishedCallbackWhenAvailable() {
val activityMock = mock(FinishedListenerTutorial::class.java)
presenter = spy(TutorialPresenter(activityMock, provider!!))

doNothing().`when`(presenter!!).circularRevealOut()
doNothing().`when`(presenter!!).revealOut()
`when`(provider!!.nextPage()).thenReturn(null)
presenter!!.onNextPressed()

Expand Down

0 comments on commit b673081

Please sign in to comment.