commonTest.io.islandtime.calendar.WeekSettingsTest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-metadata Show documentation
Show all versions of core-metadata Show documentation
A multiplatform library for working with dates and times
The newest version!
package io.islandtime.calendar
import io.islandtime.DayOfWeek
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
class WeekSettingsTest {
@Test
fun `constructor throws an exception when minimumDaysInFirstWeek is out of range`() {
assertFailsWith { WeekSettings(DayOfWeek.SUNDAY, minimumDaysInFirstWeek = 0) }
assertFailsWith { WeekSettings(DayOfWeek.SUNDAY, minimumDaysInFirstWeek = 8) }
}
@Test
fun `can be constructed when minimumDaysInFirstWeek is in range`() {
(1..7).forEach {
assertEquals(it, WeekSettings(DayOfWeek.SATURDAY, it).minimumDaysInFirstWeek)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy