From 6ad8de98dc4e301febc37fbbea0c5812c209e900 Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 11 Jan 2024 09:14:12 +0100 Subject: [PATCH] unit test --- .../data/EventDetailsRepositoryTest.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/src/test/java/org/dhis2/usescases/eventsWithoutRegistration/eventDetails/data/EventDetailsRepositoryTest.kt b/app/src/test/java/org/dhis2/usescases/eventsWithoutRegistration/eventDetails/data/EventDetailsRepositoryTest.kt index a73c8afac6..fc36818365 100644 --- a/app/src/test/java/org/dhis2/usescases/eventsWithoutRegistration/eventDetails/data/EventDetailsRepositoryTest.kt +++ b/app/src/test/java/org/dhis2/usescases/eventsWithoutRegistration/eventDetails/data/EventDetailsRepositoryTest.kt @@ -59,6 +59,19 @@ class EventDetailsRepositoryTest { d2.eventModule().events() .byEnrollmentUid().eq(ENROLLMENT_UID) .byProgramStageUid().eq(PROGRAM_STAGE_UID) + .byDeleted(), + ) doReturn mock() + whenever( + d2.eventModule().events() + .byEnrollmentUid().eq(ENROLLMENT_UID) + .byProgramStageUid().eq(PROGRAM_STAGE_UID) + .byDeleted().isFalse, + ) doReturn mock() + whenever( + d2.eventModule().events() + .byEnrollmentUid().eq(ENROLLMENT_UID) + .byProgramStageUid().eq(PROGRAM_STAGE_UID) + .byDeleted().isFalse .orderByEventDate(DESC), ) doReturn mock() @@ -66,6 +79,7 @@ class EventDetailsRepositoryTest { d2.eventModule().events() .byEnrollmentUid().eq(ENROLLMENT_UID) .byProgramStageUid().eq(PROGRAM_STAGE_UID) + .byDeleted().isFalse .orderByDueDate(DESC), ) doReturn mock() } @@ -97,6 +111,7 @@ class EventDetailsRepositoryTest { d2.eventModule().events() .byEnrollmentUid().eq(ENROLLMENT_UID) .byProgramStageUid().eq(PROGRAM_STAGE_UID) + .byDeleted().isFalse .orderByEventDate(DESC) .blockingGet(), ) doReturn listOf(event) @@ -104,6 +119,7 @@ class EventDetailsRepositoryTest { d2.eventModule().events() .byEnrollmentUid().eq(ENROLLMENT_UID) .byProgramStageUid().eq(PROGRAM_STAGE_UID) + .byDeleted().isFalse .orderByDueDate(DESC) .blockingGet(), ) doReturn emptyList() @@ -120,6 +136,7 @@ class EventDetailsRepositoryTest { d2.eventModule().events() .byEnrollmentUid().eq(ENROLLMENT_UID) .byProgramStageUid().eq(PROGRAM_STAGE_UID) + .byDeleted().isFalse .orderByEventDate(DESC) .blockingGet(), ) doReturn emptyList() @@ -127,6 +144,7 @@ class EventDetailsRepositoryTest { d2.eventModule().events() .byEnrollmentUid().eq(ENROLLMENT_UID) .byProgramStageUid().eq(PROGRAM_STAGE_UID) + .byDeleted().isFalse .orderByDueDate(DESC) .blockingGet(), ) doReturn listOf(event)