Skip to content

Commit

Permalink
testing log in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdyrod committed May 29, 2024
1 parent f806bf8 commit 6f9d15d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/test/java/org/dhis2/bindings/DateExtensionsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
}

0 comments on commit 6f9d15d

Please sign in to comment.