Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }