use of com.microsoft.graph.models.RecurrenceRange in project msgraph-sdk-java by microsoftgraph.
the class DefaultSerializerTests method testRecurrenceRangeSerialization.
@Test
public void testRecurrenceRangeSerialization() throws Exception {
final String expected = "{\"endDate\":\"2016-05-25\",\"numberOfOccurrences\":4,\"recurrenceTimeZone\":\"PST\",\"startDate\":\"2016-04-25\",\"type\":\"endDate\"}";
final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger());
RecurrenceRange brr = new RecurrenceRange();
brr.type = RecurrenceRangeType.END_DATE;
brr.startDate = new DateOnly(2016, 4, 25);
brr.endDate = new DateOnly(2016, 5, 25);
brr.recurrenceTimeZone = "PST";
brr.numberOfOccurrences = 4;
String jsonOut = serializer.serializeObject(brr);
assertNotNull(jsonOut);
assertEquals(expected, jsonOut);
}
use of com.microsoft.graph.models.RecurrenceRange in project msgraph-sdk-java by microsoftgraph.
the class DefaultSerializerTests method testRecurrenceRangeDeserialization.
@Test
public void testRecurrenceRangeDeserialization() throws Exception {
final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger());
String source = "{\n" + " \"type\": \"noEnd\",\n" + " \"startDate\": \"2016-04-27\",\n" + " \"endDate\": \"0001-01-01\",\n" + " \"recurrenceTimeZone\": \"China Standard Time\",\n" + " \"numberOfOccurrences\": 0\n" + "}";
RecurrenceRange baseRecurrenceRange = serializer.deserializeObject(source, RecurrenceRange.class);
assertNotNull(source);
assertEquals(RecurrenceRangeType.NO_END, baseRecurrenceRange.type);
assertEquals("2016-04-27", baseRecurrenceRange.startDate.toString());
assertEquals("0001-01-01", baseRecurrenceRange.endDate.toString());
assertEquals("China Standard Time", baseRecurrenceRange.recurrenceTimeZone);
assertEquals(Integer.valueOf(0), baseRecurrenceRange.numberOfOccurrences);
}
use of com.microsoft.graph.models.RecurrenceRange in project msgraph-beta-sdk-java by microsoftgraph.
the class DefaultSerializerTests method testRecurrenceRangeSerialization.
@Test
public void testRecurrenceRangeSerialization() throws Exception {
final String expected = "{\"endDate\":\"2016-05-25\",\"numberOfOccurrences\":4,\"recurrenceTimeZone\":\"PST\",\"startDate\":\"2016-04-25\",\"type\":\"endDate\"}";
final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger());
RecurrenceRange brr = new RecurrenceRange();
brr.type = RecurrenceRangeType.END_DATE;
brr.startDate = new DateOnly(2016, 4, 25);
brr.endDate = new DateOnly(2016, 5, 25);
brr.recurrenceTimeZone = "PST";
brr.numberOfOccurrences = 4;
String jsonOut = serializer.serializeObject(brr);
assertNotNull(jsonOut);
assertEquals(expected, jsonOut);
}
use of com.microsoft.graph.models.RecurrenceRange in project msgraph-beta-sdk-java by microsoftgraph.
the class DefaultSerializerTests method testRecurrenceRangeDeserialization.
@Test
public void testRecurrenceRangeDeserialization() throws Exception {
final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger());
String source = "{\n" + " \"type\": \"noEnd\",\n" + " \"startDate\": \"2016-04-27\",\n" + " \"endDate\": \"0001-01-01\",\n" + " \"recurrenceTimeZone\": \"China Standard Time\",\n" + " \"numberOfOccurrences\": 0\n" + "}";
RecurrenceRange baseRecurrenceRange = serializer.deserializeObject(source, RecurrenceRange.class);
assertNotNull(source);
assertEquals(RecurrenceRangeType.NO_END, baseRecurrenceRange.type);
assertEquals("2016-04-27", baseRecurrenceRange.startDate.toString());
assertEquals("0001-01-01", baseRecurrenceRange.endDate.toString());
assertEquals("China Standard Time", baseRecurrenceRange.recurrenceTimeZone);
assertEquals(Integer.valueOf(0), baseRecurrenceRange.numberOfOccurrences);
}
Aggregations