public virtual VisitorAction Leave(
     IntValueNode node,
     ISyntaxNode parent,
     IReadOnlyList <object> path,
     IReadOnlyList <ISyntaxNode> ancestors)
 {
     return(GetDefaultAction(node.Kind));
 }
Beispiel #2
0
        public void ValueNode_NotEquals(int avalue, int bvalue)
        {
            // arrange
            IValueNode a = new IntValueNode(avalue);
            IValueNode b = new IntValueNode(bvalue);

            // act
            bool result = a.Equals(b);

            // assert
            Assert.False(result);
        }
Beispiel #3
0
        public void ValueNode_Equals(int value)
        {
            // arrange
            IValueNode a = new IntValueNode(value);
            IValueNode b = new IntValueNode(value);

            // act
            bool result = a.Equals(b);

            // assert
            Assert.True(result);
        }
        /// <summary>
        /// Determines whether the specified <see cref="IntValueNode"/>
        /// is equal to the current <see cref="IntValueNode"/>.
        /// </summary>
        /// <param name="other">
        /// The <see cref="IntValueNode"/> to compare with the current
        /// <see cref="IntValueNode"/>.
        /// </param>
        /// <returns>
        /// <c>true</c> if the specified <see cref="IntValueNode"/> is equal
        /// to the current <see cref="IntValueNode"/>;
        /// otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(IntValueNode other)
        {
            if (other is null)
            {
                return(false);
            }

            if (ReferenceEquals(other, this))
            {
                return(true);
            }

            return(other.Value.Equals(Value, StringComparison.Ordinal));
        }
        public void IntArg(string arg)
        {
            // arrange
            byte[] sourceText = Encoding.UTF8.GetBytes(
                "{ a(b:" + arg + ") }");

            // act
            var parser = new Utf8GraphQLParser(
                sourceText, ParserOptions.Default);
            DocumentNode document = parser.Parse();

            // assert
            IntValueNode value = Assert.IsType <IntValueNode>(
                document.Definitions.OfType <OperationDefinitionNode>().First()
                .SelectionSet.Selections.OfType <FieldNode>().First()
                .Arguments.First().Value);

            Assert.Equal(arg, value.Value);
        }
 protected virtual IntValueNode RewriteIntValue(
     IntValueNode node,
     TContext context)
 {
     return(node);
 }
 public static void WriteIntValue(
     this DocumentWriter writer,
     IntValueNode node)
 {
     writer.Write(node.Value);
 }
Beispiel #8
0
 protected override void VisitIntValue(IntValueNode node)
 {
     _writer.Write(node.Value);
 }
Beispiel #9
0
 protected virtual void VisitIntValue(IntValueNode node)
 {
 }
Beispiel #10
0
 protected virtual void VisitIntValue(
     IntValueNode node,
     TContext context)
 {
 }