Sha256: 21922d657506c2907bc6fee259b406d801c7c29faae456cc0f52582594b0e984
Contents?: true
Size: 1.24 KB
Versions: 89
Compression:
Stored size: 1.24 KB
Contents
import org.junit.Test import java.time.LocalDate import java.time.LocalDateTime import java.time.Month import kotlin.test.assertEquals class GigasecondTest { @Test fun modernTime() { val gigaSecond = Gigasecond(LocalDate.of(2011, Month.APRIL, 25)) assertEquals(LocalDateTime.of(2043, Month.JANUARY, 1, 1, 46, 40), gigaSecond.date) } @Test fun afterEpochTime() { val gigaSecond = Gigasecond(LocalDate.of(1977, Month.JUNE, 13)) assertEquals(LocalDateTime.of(2009, Month.FEBRUARY, 19, 1, 46, 40), gigaSecond.date) } @Test fun beforeEpochTime() { val gigaSecond = Gigasecond(LocalDate.of(1959, Month.JULY, 19)) assertEquals(LocalDateTime.of(1991, Month.MARCH, 27, 1, 46, 40), gigaSecond.date) } @Test fun withFullTimeSpecified() { val gigaSecond = Gigasecond(LocalDateTime.of(2015, Month.JANUARY, 24, 22, 0, 0)) assertEquals(LocalDateTime.of(2046, Month.OCTOBER, 2, 23, 46, 40), gigaSecond.date) } @Test fun withFullTimeSpecifiedAndDayRollover() { val gigaSecond = Gigasecond(LocalDateTime.of(2015, Month.JANUARY, 24, 23, 59, 59)) assertEquals(LocalDateTime.of(2046, Month.OCTOBER, 3, 1, 46, 39), gigaSecond.date) } }
Version data entries
89 entries across 89 versions & 1 rubygems