public void ParseLiteral_Null_Throws()
        {
            // arrange
            var type = new ShortType();

            // act
            // assert
            Assert.Throws <ArgumentNullException>(
                () => type.ParseLiteral(null));
        }
        public void ParseLiteral_NullValueNode()
        {
            // arrange
            var type = new ShortType();

            // act
            var output = type.ParseLiteral(NullValueNode.Default);

            // assert
            Assert.Null(output);
        }
        public void ParseLiteral_Wrong_ValueNode_Throws()
        {
            // arrange
            var type  = new ShortType();
            var input = new StringValueNode("abc");

            // act
            // assert
            Assert.Throws <ScalarSerializationException>(
                () => type.ParseLiteral(input));
        }
        public void ParseLiteral_IntLiteral()
        {
            // arrange
            var type    = new ShortType();
            var literal = new IntValueNode(1);

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

            // assert
            Assert.IsType <short>(value);
            Assert.Equal(literal.ToInt16(), value);
        }