Merge pull request #1942 from foralost/#1941_DateUtilsTest_failing

#1941 DateUtils test fix
pull/1985/head
Alinson S. Xavier 2 years ago committed by GitHub
commit 46fe683d71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -120,10 +120,15 @@ class DateUtilsTest : BaseUnitTest() {
@Test @Test
fun getWeekdaysInMonth() { fun getWeekdaysInMonth() {
val february = GregorianCalendar(2018, Calendar.FEBRUARY, 1) fun getCalendarUTC(year: Int, month: Int, dayOfMonth: Int) =
val leapFebruary = GregorianCalendar(2020, Calendar.FEBRUARY, 1) GregorianCalendar(year, month, dayOfMonth).apply {
val month = GregorianCalendar(2020, Calendar.APRIL, 1) timeZone = TimeZone.getTimeZone("UTC")
val longMonth = GregorianCalendar(2020, Calendar.AUGUST, 1) }
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( assertThat(
arrayOf(4, 4, 4, 4, 4, 4, 4), arrayOf(4, 4, 4, 4, 4, 4, 4),

Loading…
Cancel
Save