示例#1
0
        protected void LocalTime_ExpectSerializeUtcToMatch()
        {
            // arrange
            ScalarType     scalar        = new LocalTimeType();
            DateTimeOffset dateTime      = new DateTime(2018, 6, 11, 8, 46, 14, DateTimeKind.Utc);
            const string   expectedValue = "08:46:14";

            // act
            string serializedValue = (string)scalar.Serialize(dateTime) !;

            // assert
            Assert.Equal(expectedValue, serializedValue);
        }
示例#2
0
        protected void LocalTime_ExpectSerializeDateTimeOffsetToMatch()
        {
            // arrange
            ScalarType scalar   = new LocalTimeType();
            var        dateTime = new DateTimeOffset(
                new DateTime(2018, 6, 11, 8, 46, 14),
                new TimeSpan(4, 0, 0));
            string expectedValue = "08:46:14";

            // act
            string serializedValue = (string)scalar.Serialize(dateTime) !;

            // assert
            Assert.Equal(expectedValue, serializedValue);
        }