|
8 | 8 | import org.junit.Test; |
9 | 9 |
|
10 | 10 | public class UseLocalDateUnitTest { |
11 | | - |
| 11 | + |
12 | 12 | UseLocalDate useLocalDate = new UseLocalDate(); |
13 | | - |
| 13 | + |
14 | 14 | @Test |
15 | | - public void givenValues_whenUsingFactoryOf_thenLocalDate(){ |
16 | | - Assert.assertEquals("2016-05-10",useLocalDate.getLocalDateUsingFactoryOfMethod(2016,5,10).toString()); |
| 15 | + public void givenValues_whenUsingFactoryOf_thenLocalDate() { |
| 16 | + Assert.assertEquals("2016-05-10", useLocalDate.getLocalDateUsingFactoryOfMethod(2016, 5, 10).toString()); |
17 | 17 | } |
18 | | - |
| 18 | + |
19 | 19 | @Test |
20 | | - public void givenString_whenUsingParse_thenLocalDate(){ |
21 | | - Assert.assertEquals("2016-05-10",useLocalDate.getLocalDateUsingParseMethod("2016-05-10").toString()); |
| 20 | + public void givenString_whenUsingParse_thenLocalDate() { |
| 21 | + Assert.assertEquals("2016-05-10", useLocalDate.getLocalDateUsingParseMethod("2016-05-10").toString()); |
22 | 22 | } |
23 | | - |
| 23 | + |
24 | 24 | @Test |
25 | | - public void whenUsingClock_thenLocalDate(){ |
26 | | - Assert.assertEquals(LocalDate.now(),useLocalDate.getLocalDateFromClock()); |
| 25 | + public void whenUsingClock_thenLocalDate() { |
| 26 | + Assert.assertEquals(LocalDate.now(), useLocalDate.getLocalDateFromClock()); |
27 | 27 | } |
28 | | - |
| 28 | + |
29 | 29 | @Test |
30 | | - public void givenDate_whenUsingPlus_thenNextDay(){ |
31 | | - Assert.assertEquals(LocalDate.now().plusDays(1),useLocalDate.getNextDay(LocalDate.now())); |
| 30 | + public void givenDate_whenUsingPlus_thenNextDay() { |
| 31 | + Assert.assertEquals(LocalDate.now().plusDays(1), useLocalDate.getNextDay(LocalDate.now())); |
32 | 32 | } |
33 | | - |
| 33 | + |
34 | 34 | @Test |
35 | | - public void givenDate_whenUsingMinus_thenPreviousDay(){ |
36 | | - Assert.assertEquals(LocalDate.now().minusDays(1),useLocalDate.getPreviousDay(LocalDate.now())); |
| 35 | + public void givenDate_whenUsingMinus_thenPreviousDay() { |
| 36 | + Assert.assertEquals(LocalDate.now().minusDays(1), useLocalDate.getPreviousDay(LocalDate.now())); |
37 | 37 | } |
38 | | - |
| 38 | + |
39 | 39 | @Test |
40 | | - public void givenToday_whenUsingGetDayOfWeek_thenDayOfWeek(){ |
41 | | - Assert.assertEquals(DayOfWeek.SUNDAY,useLocalDate.getDayOfWeek(LocalDate.parse("2016-05-22"))); |
| 40 | + public void givenToday_whenUsingGetDayOfWeek_thenDayOfWeek() { |
| 41 | + Assert.assertEquals(DayOfWeek.SUNDAY, useLocalDate.getDayOfWeek(LocalDate.parse("2016-05-22"))); |
42 | 42 | } |
43 | | - |
| 43 | + |
44 | 44 | @Test |
45 | | - public void givenToday_whenUsingWithTemporalAdjuster_thenFirstDayOfMonth(){ |
46 | | - Assert.assertEquals(1,useLocalDate.getFirstDayOfMonth().getDayOfMonth()); |
| 45 | + public void givenToday_whenUsingWithTemporalAdjuster_thenFirstDayOfMonth() { |
| 46 | + Assert.assertEquals(1, useLocalDate.getFirstDayOfMonth().getDayOfMonth()); |
47 | 47 | } |
48 | | - |
| 48 | + |
49 | 49 | @Test |
50 | | - public void givenLocalDate_whenUsingAtStartOfDay_thenReturnMidnight(){ |
51 | | - Assert.assertEquals(LocalDateTime.parse("2016-05-22T00:00:00"),useLocalDate.getStartOfDay(LocalDate.parse("2016-05-22"))); |
| 50 | + public void givenLocalDate_whenUsingAtStartOfDay_thenReturnMidnight() { |
| 51 | + Assert.assertEquals(LocalDateTime.parse("2016-05-22T00:00:00"), useLocalDate.getStartOfDay(LocalDate.parse("2016-05-22"))); |
52 | 52 | } |
53 | 53 |
|
54 | 54 | } |
0 commit comments