|
4 | 4 |
|
5 | 5 | import com.microsoft.graph.model.DateOnly; |
6 | 6 |
|
7 | | -public class DateOnlySerializerTest extends AndroidTestCase { |
| 7 | +public class DateOnlyTests extends AndroidTestCase { |
8 | 8 |
|
9 | 9 | public void testDateSerializer() throws Exception { |
10 | | - String strDate = DateOnlySerializer.serialize(DateOnly.parse("2016-04-27")); |
| 10 | + String strDate = DateOnly.parse("2016-04-27").toString(); |
11 | 11 | assertEquals("2016-04-27", strDate); |
12 | 12 | } |
13 | 13 |
|
14 | 14 | public void testDateSerializerIndefinite() throws Exception { |
15 | | - String strDate = DateOnlySerializer.serialize(DateOnly.parse("0001-01-01")); |
| 15 | + String strDate = DateOnly.parse("0001-01-01").toString(); |
16 | 16 | assertEquals("0001-01-01", strDate); |
17 | 17 | } |
18 | 18 |
|
19 | 19 | public void testDateDeserializer() throws Exception { |
20 | | - DateOnly date = DateOnlySerializer.deserialize("2016-04-27"); |
| 20 | + DateOnly date = DateOnly.parse("2016-04-27"); |
21 | 21 | assertEquals(2016, date.getYear()); |
22 | 22 | assertEquals(4, date.getMonth()); |
23 | 23 | assertEquals(27, date.getDay()); |
24 | 24 | } |
25 | 25 |
|
26 | 26 | public void testDateDeserializerIndefinite() throws Exception{ |
27 | | - DateOnly date = DateOnlySerializer.deserialize("0001-01-01"); |
| 27 | + DateOnly date = DateOnly.parse("0001-01-01"); |
28 | 28 | assertEquals(1, date.getYear()); |
29 | 29 | assertEquals(1, date.getMonth()); |
30 | 30 | assertEquals(1, date.getDay()); |
|
0 commit comments