示例#1
0
        public void ParseLiteral_Null_Throws()
        {
            // arrange
            var type = new IdType();

            // act
            // assert
            Assert.Throws <ArgumentNullException>(() => type.ParseLiteral(null));
        }
示例#2
0
        public void ParseLiteral_Wrong_ValueNode_Throws()
        {
            // arrange
            var            type  = new IdType();
            FloatValueNode input = new FloatValueNode("123456");

            // act
            // assert
            Assert.Throws <ArgumentException>(() => type.ParseLiteral(input));
        }
示例#3
0
        public void ParseLiteral_Wrong_ValueNode_Throws()
        {
            // arrange
            var type  = new IdType();
            var input = new FloatValueNode("123456");

            // act
            // assert
            Assert.Throws <ScalarSerializationException>(
                () => type.ParseLiteral(input));
        }
示例#4
0
        public void ParseLiteral_NullValueNode()
        {
            // arrange
            var           type  = new IdType();
            NullValueNode input = NullValueNode.Default;

            // act
            object output = type.ParseLiteral(input);

            // assert
            Assert.Null(output);
        }
示例#5
0
        public void ParseLiteral_IntValueNode()
        {
            // arrange
            var type  = new IdType();
            var input = new IntValueNode("123456");

            // act
            object output = type.ParseLiteral(input);

            // assert
            Assert.IsType <string>(output);
            Assert.Equal("123456", output);
        }