package de.interseroh.report.formatters;

import java.sql.Date;
import java.util.Locale;

import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * @author Ingo Düppe (Crowdcode)
 */
public class DateFormatterTest {

	private static final Date testDate = new Date(1488063600000L);

    private static final DateFormatter formatter = new DateFormatter();

	@Test
	public void testParse() throws Exception {
		Date date = formatter.parse("02/26/17", Locale.US);
		assertThat(date, is(testDate));
	}

	@Test
	public void testPrint() throws Exception {
        String print = formatter.print(testDate, Locale.US);
		assertThat(print, is("2/26/17"));
	}

    @Test
    public void testParseGermanDate() throws Exception {
		Date date = formatter.parse("26.02.2017", Locale.GERMAN);
		assertThat(date, is(testDate));
    }

    @Test
    public void testPrintGermanDate() throws Exception {
        String print = formatter.print(testDate, Locale.GERMAN);
		assertThat(print, is("26.02.17"));

    }
}
@@ -270,73 +270,8 @@
  %7B%0A%0A
-%09private static final Date testDate = new Date(1488063600000L);%0A%0A
     
@@ -461,107 +461,8 @@
 hat(
-date, is(testDate));%0A%09%7D%0A%0A%09@Test%0A%09public void testPrint() throws Exception %7B%0A        String print = 
 form
@@ -465,37 +465,33 @@
 formatter.print(
-testD
+d
 ate, Locale.US);
@@ -489,36 +489,16 @@
 cale.US)
-;%0A%09%09assertThat(print
 , is(%222/
@@ -655,126 +655,8 @@
 hat(
-date, is(testDate));%0A    %7D%0A%0A    @Test%0A    public void testPrintGermanDate() throws Exception %7B%0A        String print = 
 form
@@ -671,13 +671,9 @@
 int(
-testD
+d
 ate,
@@ -691,28 +691,8 @@
 MAN)
-;%0A%09%09assertThat(print
 , is
@@ -710,12 +710,9 @@
 ));%0A
-%0A    %7D
+%09%7D%0A
 %0A%7D

fix test