diff --git a/app/src/test/java/org/dhis2/bindings/DateExtensionsTest.kt b/app/src/test/java/org/dhis2/bindings/DateExtensionsTest.kt index 7109896574..99aed2431f 100644 --- a/app/src/test/java/org/dhis2/bindings/DateExtensionsTest.kt +++ b/app/src/test/java/org/dhis2/bindings/DateExtensionsTest.kt @@ -208,14 +208,14 @@ class DateExtensionsTest { fun `Should return 'In x days', when the scheduled date is same day but different month and same year`() { val currentDate = currentCalendar().time val date: Date? = currentCalendar().apply { - add(Calendar.MONTH, 1) + add(Calendar.MONTH, 2) }.time - whenever(resourceManager.getPlural(R.plurals.schedule_days, 30, 30)) doReturn "In 30 days" + whenever(resourceManager.getPlural(R.plurals.schedule_days, 60, 60)) doReturn "In 60 days" // System.out.println("CurrentDATE: $currentDate") // System.out.println("Overdue text: ${date.toOverdueOrScheduledUiText(resourceManager, currentDate)}") val label = date.toOverdueOrScheduledUiText(resourceManager, currentDate, true) System.out.println("FERDY: $label") - assert(date.toOverdueOrScheduledUiText(resourceManager, currentDate, true) == "In 30 days") + assert(date.toOverdueOrScheduledUiText(resourceManager, currentDate, true) == "In 60 days") } @Test @@ -258,7 +258,7 @@ class DateExtensionsTest { assert(date.toOverdueOrScheduledUiText(resourceManager, currentDate) == "In 3 years") } - private fun currentCalendar() = Calendar.getInstance(Locale.getDefault()).apply { + private fun currentCalendar() = Calendar.getInstance(Locale.US).apply { time = "2020-03-02T00:00:00.00Z".toDate() } }