Exemplo n.º 1
0
        public void ParseLiteral_Null_Throws()
        {
            // arrange
            var type = new LongType();

            // act
            // assert
            Assert.Throws <ArgumentNullException>(
                () => type.ParseLiteral(null));
        }
Exemplo n.º 2
0
        public void ParseLiteral_NullValueNode()
        {
            // arrange
            var type = new LongType();

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

            // assert
            Assert.Null(output);
        }
Exemplo n.º 3
0
        public void ParseLiteral_Wrong_ValueNode_Throws()
        {
            // arrange
            var type  = new LongType();
            var input = new StringValueNode("abc");

            // act
            // assert
            Assert.Throws <SerializationException>(
                () => type.ParseLiteral(input));
        }
Exemplo n.º 4
0
        public void ParseLiteral_IntLiteral()
        {
            // arrange
            var type    = new LongType();
            var literal = new IntValueNode(1);

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

            // assert
            Assert.IsType <long>(value);
            Assert.Equal(literal.ToInt64(), value);
        }