package com.alexstyl.specialdates.util;

import com.alexstyl.specialdates.date.Date;
import com.alexstyl.specialdates.date.DateParseException;

import org.junit.Test;

import static org.fest.assertions.api.Assertions.assertThat;

public class DateParserTest {

    private DateParser dateParser = new DateParser();

    @Test
    public void canParseDatesWithDashes() throws DateParseException {
        String dateDashes = "13/Jan/1972";
        Date parsed = dateParser.parse(dateDashes);
        assertThat(parsed).isEqualTo(Date.on(13, 1, 1972));
    }

    @Test
    public void canParseLongDates() throws DateParseException {
        String dateDashes = "1949-02-14T00:00:00Z";
        Date parsed = dateParser.parse(dateDashes);
        assertThat(parsed).isEqualTo(Date.on(14, 2, 1949));
    }

    @Test
    public void canParseLongDates2() throws DateParseException {
        String dateDashes = "20151026T083936Z";
        Date parsed = dateParser.parse(dateDashes);
        assertThat(parsed).isEqualTo(Date.on(26, 10, 2015));
    }

    @Test
    public void canParseLongDates3() throws DateParseException {
        String dateDashes = "--02-29";
        Date parsed = dateParser.parse(dateDashes);
        assertThat(parsed).isEqualTo(Date.on(29, 2));
    }

    @Test(expected = NullPointerException.class)
    public void throwsExceptionWhenNullIsPassed() throws DateParseException {
        dateParser.parse(null);
    }
}

@@ -161,16 +161,78 @@
 .Test;%0A%0A
+import static com.alexstyl.specialdates.date.DateConstants.*;%0A
 import s
@@ -401,26 +401,18 @@
 oid 
-canParseD
+d
 ate
-s
 With
-D
+Sl
 ashe
@@ -587,17 +587,23 @@
 .on(13, 
-1
+JANUARY
 , 1972))
@@ -637,33 +637,24 @@
 ic void 
-canParseL
+l
 ongDate
-s
 () throw
@@ -829,17 +829,24 @@
 .on(14, 
-2
+FEBRUARY
 , 1949))
@@ -880,33 +880,24 @@
 ic void 
-canParseL
+l
 ongDate
-s
 2() thro
@@ -1069,18 +1069,23 @@
 .on(26, 
-10
+OCTOBER
 , 2015))
@@ -1123,26 +1123,510 @@
 oid 
-canParseLongDates3
+datesWithDashes() throws DateParseException %7B%0A        String dateDashes = %222016-03-29%22;%0A        Date parsed = dateParser.parse(dateDashes);%0A        assertThat(parsed).isEqualTo(Date.on(29, MARCH, 2016));%0A    %7D%0A%0A    @Test%0A    public void datesWithDashesWithoutYear() throws DateParseException %7B%0A        String dateDashes = %22--03-29%22;%0A        Date parsed = dateParser.parse(dateDashes);%0A        assertThat(parsed).isEqualTo(Date.on(29, MARCH));%0A    %7D%0A%0A    @Test%0A    public void noYear_on_29th_Of_February
 () t
@@ -1792,17 +1792,24 @@
 .on(29, 
-2
+FEBRUARY
 ));%0A    

Rename tests for clarity