public void ParseValue_Null() { // arrange var dateType = new DateType(); var dateTime = new DateTime(2018, 6, 11, 8, 46, 14, DateTimeKind.Utc); string expectedLiteralValue = "2018-06-11"; // act var stringLiteral = (StringValueNode)dateType.ParseValue(dateTime); // assert Assert.Equal(expectedLiteralValue, stringLiteral.Value); }
public void ParseValue_DateTimeOffset() { // arrange DateType dateType = new DateType(); DateTimeOffset dateTime = new DateTimeOffset( new DateTime(2018, 6, 11, 8, 46, 14), new TimeSpan(4, 0, 0)); string expectedLiteralValue = "2018-06-11"; // act StringValueNode stringLiteral = (StringValueNode)dateType.ParseValue(dateTime); // assert Assert.Equal(expectedLiteralValue, stringLiteral.Value); }