Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmateos committed Apr 29, 2024
1 parent e22f516 commit 0599920
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class DashboardViewModelTest {
whenever(repository.updateEnrollmentStatus(any(), any())) doReturn Observable.just(
StatusChangeResultCode.CHANGED,
)
whenever(mockedEnrollmentModel.currentEnrollment) doReturn mockedCompletedEnrollment
updateEnrollmentStatus(EnrollmentStatus.COMPLETED)
testingDispatcher.scheduler.advanceUntilIdle()
verify(repository).updateEnrollmentStatus("enrollmentUid", EnrollmentStatus.COMPLETED)
Expand Down Expand Up @@ -186,4 +187,10 @@ class DashboardViewModelTest {
on { aggregatedSyncState() } doReturn State.SYNCED
on { status() } doReturn EnrollmentStatus.ACTIVE
}

private val mockedCompletedEnrollment: Enrollment = mock {
on { uid() } doReturn "enrollmentUid"
on { aggregatedSyncState() } doReturn State.TO_UPDATE
on { status() } doReturn EnrollmentStatus.COMPLETED
}
}

0 comments on commit 0599920

Please sign in to comment.