Added 'thens' to conform with given_when_then format

This commit is contained in:
Sam Millington 2018-10-21 18:06:39 +01:00 committed by GitHub
parent a7276eb191
commit 06be85c4a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -18,19 +18,19 @@ public class SimpleDateFormatUnitTest {
private static final Logger logger = Logger.getLogger(SimpleDateFormatUnitTest.class.getName()); private static final Logger logger = Logger.getLogger(SimpleDateFormatUnitTest.class.getName());
@Test @Test
public void givenSpecificDate_whenFormatted_checkFormatCorrect() throws Exception { public void givenSpecificDate_whenFormatted_thenCheckFormatCorrect() throws Exception {
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
assertEquals("24-05-1977", formatter.format(new Date(233345223232L))); assertEquals("24-05-1977", formatter.format(new Date(233345223232L)));
} }
@Test @Test
public void givenSpecificDate_whenFormattedUsingDateFormat_checkFormatCorrect() throws Exception { public void givenSpecificDate_whenFormattedUsingDateFormat_thenCheckFormatCorrect() throws Exception {
DateFormat formatter = DateFormat.getDateInstance(DateFormat.SHORT); DateFormat formatter = DateFormat.getDateInstance(DateFormat.SHORT);
assertEquals("5/24/77", formatter.format(new Date(233345223232L))); assertEquals("5/24/77", formatter.format(new Date(233345223232L)));
} }
@Test @Test
public void givenStringDate_whenParsed_checkDateCorrect() throws Exception{ public void givenStringDate_whenParsed_thenCheckDateCorrect() throws Exception{
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
Date myDate = new Date(233276400000L); Date myDate = new Date(233276400000L);
Date parsedDate = formatter.parse("24-05-1977"); Date parsedDate = formatter.parse("24-05-1977");
@ -38,14 +38,14 @@ public class SimpleDateFormatUnitTest {
} }
@Test @Test
public void givenFranceLocale_whenFormatted_checkFormatCorrect() throws Exception{ public void givenFranceLocale_whenFormatted_thenCheckFormatCorrect() throws Exception{
SimpleDateFormat franceDateFormatter = new SimpleDateFormat("EEEEE dd-MMMMMMM-yyyy", Locale.FRANCE); SimpleDateFormat franceDateFormatter = new SimpleDateFormat("EEEEE dd-MMMMMMM-yyyy", Locale.FRANCE);
Date myWednesday = new Date(1539341312904L); Date myWednesday = new Date(1539341312904L);
assertTrue(franceDateFormatter.format(myWednesday).startsWith("vendredi")); assertTrue(franceDateFormatter.format(myWednesday).startsWith("vendredi"));
} }
@Test @Test
public void given2TimeZones_whenFormatted_checkTimeDifference() throws Exception { public void given2TimeZones_whenFormatted_thenCheckTimeDifference() throws Exception {
Date now = new Date(); Date now = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEEE dd-MMM-yy HH:mm:ssZ"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEEE dd-MMM-yy HH:mm:ssZ");