Beispiel #1
0
 public static void AcceptCallsVisitEqualsMethodOfSyntaxNodeVisitor()
 {
     var visitor = Substitute.For<SyntaxNodeVisitor>();
     var node = new Equals(default(int));
     node.Accept(visitor);
     visitor.Received().VisitEquals(node);
 }
Beispiel #2
0
        public static void AcceptCallsVisitEqualsMethodOfSyntaxNodeVisitor()
        {
            var visitor = Substitute.For <SyntaxNodeVisitor>();
            var node    = new Equals(default(int));

            node.Accept(visitor);
            visitor.Received().VisitEquals(node);
        }
Beispiel #3
0
        public static void VisitEqualsCallsVisitSyntaxTokenToAllowProcessingAllSyntaxTokensPolymorphically()
        {
            var visitor = Substitute.ForPartsOf <SyntaxNodeVisitor>();
            var equals  = new Equals(0);

            visitor.VisitEquals(equals);
            visitor.Received().VisitSyntaxToken(equals);
            Assert.Equal(typeof(SyntaxToken), typeof(Equals).BaseType);
        }
Beispiel #4
0
 public static void ChildNodesReturnsNodesSpecifiedInConstructor()
 {
     var name = new AttributeName(0, "language");
     var equals = new Equals(8);
     var quote1 = new DoubleQuote(9);
     var value = new AttributeValue(10, "C#");
     var quote2 = new DoubleQuote(12);
     var attribute = new Attribute(name, equals, quote1, value, quote2);
     Assert.True(new SyntaxNode[] { name, equals, quote1, value, quote2 }.SequenceEqual(attribute.ChildNodes()));
 }
Beispiel #5
0
        public static void ChildNodesReturnsNodesSpecifiedInConstructor()
        {
            var name      = new AttributeName(0, "language");
            var equals    = new Equals(8);
            var quote1    = new DoubleQuote(9);
            var value     = new AttributeValue(10, "C#");
            var quote2    = new DoubleQuote(12);
            var attribute = new Attribute(name, equals, quote1, value, quote2);

            Assert.True(new SyntaxNode[] { name, equals, quote1, value, quote2 }.SequenceEqual(attribute.ChildNodes()));
        }
Beispiel #6
0
        public Attribute(AttributeName name, Equals equals, DoubleQuote quote1, AttributeValue value, DoubleQuote quote2)
        {
            Debug.Assert(name != null, "name");
            Debug.Assert(equals != null, "equals");
            Debug.Assert(quote1 != null, "quote1");
            Debug.Assert(value != null, "value");
            Debug.Assert(quote2 != null, "quote2");

            this.name   = name;
            this.equals = equals;
            this.quote1 = quote1;
            this.value  = value;
            this.quote2 = quote2;
        }
Beispiel #7
0
        public Attribute(AttributeName name, Equals equals, DoubleQuote quote1, AttributeValue value, DoubleQuote quote2)
        {
            Debug.Assert(name != null, "name");
            Debug.Assert(equals != null, "equals");
            Debug.Assert(quote1 != null, "quote1");
            Debug.Assert(value != null, "value");
            Debug.Assert(quote2 != null, "quote2");

            this.name = name;
            this.equals = equals;
            this.quote1 = quote1;
            this.value = value;
            this.quote2 = quote2;
        }
 public static void VisitEqualsCallsVisitSyntaxTokenToAllowProcessingAllSyntaxTokensPolymorphically()
 {
     var visitor = Substitute.ForPartsOf<SyntaxNodeVisitor>();
     var equals = new Equals(0);
     visitor.VisitEquals(equals);
     visitor.Received().VisitSyntaxToken(equals);
     Assert.Equal(typeof(SyntaxToken), typeof(Equals).BaseType);
 }
 protected internal virtual void VisitEquals(Equals node)
 {
     this.VisitSyntaxToken(node);
 }
Beispiel #10
0
 protected internal virtual void VisitEquals(Equals node)
 {
     this.VisitSyntaxToken(node);
 }