Sha256: 6f1aa718293ecb0c0284f8dcdca0c7312219626c4f7d7ae7b6827b0673995c9e

Contents?: true

Size: 1.46 KB

Versions: 163

Compression:

Stored size: 1.46 KB

Contents

import org.junit.Test;
import org.junit.Ignore;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Month;

import static org.junit.Assert.assertEquals;

public class GigasecondTest {


    @Test
    public void modernTime() {
        Gigasecond gigaSecond = new Gigasecond(LocalDate.of(2011, Month.APRIL, 25));

        assertEquals(LocalDateTime.of(2043, Month.JANUARY, 1, 1, 46, 40), gigaSecond.getDate());
    }

    @Ignore
    @Test
    public void afterEpochTime() {
        Gigasecond gigaSecond = new Gigasecond(LocalDate.of(1977, Month.JUNE, 13));

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

    @Ignore
    @Test
    public void beforeEpochTime() {
        Gigasecond gigaSecond = new Gigasecond(LocalDate.of(1959, Month.JULY, 19));

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

    @Ignore
    @Test
    public void withFullTimeSpecified() {
        Gigasecond gigaSecond = new Gigasecond(LocalDateTime.of(2015, Month.JANUARY, 24, 22, 0, 0));

        assertEquals(LocalDateTime.of(2046, Month.OCTOBER, 2, 23, 46, 40), gigaSecond.getDate());
    }

    @Ignore
    @Test
    public void withFullTimeSpecifiedAndDayRollover() {
        Gigasecond gigaSecond = new Gigasecond(LocalDateTime.of(2015, Month.JANUARY, 24, 23, 59, 59));

        assertEquals(LocalDateTime.of(2046, Month.OCTOBER, 3, 1, 46, 39), gigaSecond.getDate());
    }
}

Version data entries

163 entries across 163 versions & 1 rubygems

Version Path
trackler-2.1.0.7 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.1.0.6 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.1.0.5 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.1.0.4 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.1.0.3 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.1.0.2 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.1.0.1 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.1.0.0 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.55 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.54 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.53 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.52 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.51 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.50 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.49 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.48 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.47 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.46 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.45 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java
trackler-2.0.8.44 tracks/java/exercises/gigasecond/src/test/java/GigasecondTest.java