예제 #1
0
        public void ParseLiteral_NullValueNode()
        {
            // arrange
            var           timeSpanType = new TimeSpanType();
            NullValueNode literal      = NullValueNode.Default;

            // act
            object value = timeSpanType.ParseLiteral(literal);

            // assert
            Assert.Null(value);
        }
예제 #2
0
        public void ParseLiteral_StringValueNode(TimeSpanFormat format, string literalValue)
        {
            // arrange
            var timeSpanType     = new TimeSpanType(format);
            var literal          = new StringValueNode(literalValue);
            var expectedTimeSpan = TimeSpan.FromMinutes(5);

            // act
            var timeSpan = (TimeSpan)timeSpanType
                           .ParseLiteral(literal);

            // assert
            Assert.Equal(expectedTimeSpan, timeSpan);
        }