Sha256: 965858adfaf26e3556cd59caeca907b5a169a74c99d5781f420dad47b6261de7

Contents?: true

Size: 1.31 KB

Versions: 126

Compression:

Stored size: 1.31 KB

Contents

import org.junit.Test
import org.junit.Ignore
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)
    }

    @Ignore
    @Test
    fun afterEpochTime() {
        val gigaSecond = Gigasecond(LocalDate.of(1977, Month.JUNE, 13))

        assertEquals(LocalDateTime.of(2009, Month.FEBRUARY, 19, 1, 46, 40), gigaSecond.date)
    }

    @Ignore
    @Test
    fun beforeEpochTime() {
        val gigaSecond = Gigasecond(LocalDate.of(1959, Month.JULY, 19))

        assertEquals(LocalDateTime.of(1991, Month.MARCH, 27, 1, 46, 40), gigaSecond.date)
    }

    @Ignore
    @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)
    }

    @Ignore
    @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

126 entries across 126 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.179 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.178 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.177 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.176 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.175 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.174 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.173 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.172 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.171 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.170 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.169 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.167 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.166 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.165 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.164 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.163 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.162 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.161 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt
trackler-2.2.1.160 tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt