Пример #1
0
        public void ParseValue_Nullable()
        {
            // arrange
            var   type  = new ShortType();
            short?input = 123;

            // act
            IntValueNode output = (IntValueNode)type.ParseValue(input);

            // assert
            Assert.Equal(123, output.ToDouble());
        }
Пример #2
0
        public void ParseLiteral_IntLiteral()
        {
            // arrange
            var type    = new FloatType();
            var literal = new IntValueNode(123);

            // act
            var value = type.ParseLiteral(literal);

            // assert
            Assert.IsType <double>(value);
            Assert.Equal(literal.ToDouble(), value);
        }