package io.github.t73liu.util;

import org.junit.jupiter.api.Test;

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

import static org.junit.jupiter.api.Assertions.assertEquals;

public class DateUtilTest {
    @Test
    public void testLongUnixTimestampToLocalDate() {
        assertEquals(LocalDateTime.of(2017, 6, 28, 23, 22, 19), DateUtil.unixTimeStampToLocalDateTime(1498706539));
    }

    @Test
    public void testStringUnixTimestampToLocalDate() {
        assertEquals(LocalDateTime.of(2017, 6, 28, 23, 22, 19), DateUtil.unixTimeStampToLocalDateTime("1498706539"));
    }

    @Test
    public void testLocalDateTimeToUnixTimestamp() {
        assertEquals(1504577942, DateUtil.localDateTimeToUnixTimestamp(LocalDateTime.of(2017, 9, 4, 22, 19, 2)));
    }

    @Test
    public void testISODateStringToLocalDate() {
        assertEquals(LocalDate.of(2017, 6, 30), DateUtil.parseLocalDateISO("2017-06-30"));
    }

    @Test
    public void testLocalDateToISODateString() {
        assertEquals("2017-06-30", DateUtil.formatLocalDateISO(LocalDate.of(2017, 6, 30)));
    }

    @Test
    public void testShortDateStringToLocalDate() {
        assertEquals(LocalDate.of(2017, 6, 30), DateUtil.parseLocalDateShort("20170630"));
    }

    @Test
    public void testLocalDateToShortDateString() {
        assertEquals("20170630", DateUtil.formatLocalDateShort(LocalDate.of(2017, 6, 30)));
    }
}
@@ -120,16 +120,48 @@
 ateTime;
+%0Aimport java.time.ZonedDateTime;
 %0A%0Aimport
@@ -1436,10 +1436,238 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testUnixTimestampToZonedDateTime() %7B%0A        assertEquals(ZonedDateTime.of(2017, 10, 14, 12, 39, 36, 0, DateUtil.TIMEZONE_ID),%0A                DateUtil.unixTimeStampToZonedDateTime(1507999176));%0A    %7D
 %0A%7D

Add test for unixTimeStampToZonedDateTime