Skip to content

Commit

Permalink
Merge pull request #1942 from foralost/#1941_DateUtilsTest_failing
Browse files Browse the repository at this point in the history
#1941 DateUtils test fix
  • Loading branch information
iSoron committed Apr 5, 2024
2 parents c216fb0 + 7f62481 commit 46fe683
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,15 @@ class DateUtilsTest : BaseUnitTest() {

@Test
fun getWeekdaysInMonth() {
val february = GregorianCalendar(2018, Calendar.FEBRUARY, 1)
val leapFebruary = GregorianCalendar(2020, Calendar.FEBRUARY, 1)
val month = GregorianCalendar(2020, Calendar.APRIL, 1)
val longMonth = GregorianCalendar(2020, Calendar.AUGUST, 1)
fun getCalendarUTC(year: Int, month: Int, dayOfMonth: Int) =
GregorianCalendar(year, month, dayOfMonth).apply {
timeZone = TimeZone.getTimeZone("UTC")
}

val february = getCalendarUTC(2018, Calendar.FEBRUARY, 1)
val leapFebruary = getCalendarUTC(2020, Calendar.FEBRUARY, 1)
val month = getCalendarUTC(2020, Calendar.APRIL, 1)
val longMonth = getCalendarUTC(2020, Calendar.AUGUST, 1)

assertThat(
arrayOf(4, 4, 4, 4, 4, 4, 4),
Expand Down

0 comments on commit 46fe683

Please sign in to comment.