protected void LocalDate_ExpectSerializeDateTimeOffsetToMatch() { // arrange ScalarType scalar = new LocalDateType(); var dateTime = new DateTimeOffset( new DateTime(2018, 6, 11, 8, 46, 14), new TimeSpan(4, 0, 0)); string expectedValue = "2018-06-11"; // act string serializedValue = (string)scalar.Serialize(dateTime) !; // assert Assert.Equal(expectedValue, serializedValue); }
protected void LocalDate_ExpectSerializeUtcToMatch() { // arrange ScalarType scalar = new LocalDateType(); DateTimeOffset dateTime = new DateTime( 2018, 6, 11, 8, 46, 14, DateTimeKind.Utc); string expectedValue = "2018-06-11"; // act string serializedValue = (string)scalar.Serialize(dateTime) !; // assert Assert.Equal(expectedValue, serializedValue); }