Ejemplo n.º 1
0
        public void ParseValue_Null()
        {
            // arrange
            var type = new FieldSetType();

            // act
            IValueNode valueSyntax = type.ParseValue(null);

            // assert
            Assert.IsType <NullValueNode>(valueSyntax);
        }
Ejemplo n.º 2
0
        public void ParseValue_InvalidValue()
        {
            // arrange
            var type = new FieldSetType();

            // act
            void Action() => type.ParseValue(1);

            // assert
            Assert.Throws <SerializationException>(Action);
        }
Ejemplo n.º 3
0
        public void ParseValue()
        {
            // arrange
            var type = new FieldSetType();
            SelectionSetNode selectionSet =
                Utf8GraphQLParser.Syntax.ParseSelectionSet("{ a b c d e(d: $b) }");

            // act
            IValueNode valueSyntax = type.ParseValue(selectionSet);

            // assert
            Assert.Equal(
                "a b c d e(d: $b)",
                Assert.IsType <StringValueNode>(valueSyntax).Value);
        }