Beispiel #1
0
 public static void AcceptCallsVisitDoubleQuoteMethodOfSyntaxNodeVisitor()
 {
     var visitor = Substitute.For<SyntaxNodeVisitor>();
     var syntaxNode = new DoubleQuote(default(int));
     syntaxNode.Accept(visitor);
     visitor.Received().VisitDoubleQuote(syntaxNode);
 }
Beispiel #2
0
        public static void AcceptCallsVisitDoubleQuoteMethodOfSyntaxNodeVisitor()
        {
            var visitor    = Substitute.For <SyntaxNodeVisitor>();
            var syntaxNode = new DoubleQuote(default(int));

            syntaxNode.Accept(visitor);
            visitor.Received().VisitDoubleQuote(syntaxNode);
        }
Beispiel #3
0
        public static void VisitDoubleQuoteCallsVisitSyntaxTokenToAllowProcessingAllSyntaxTokensPolymorphically()
        {
            var visitor     = Substitute.ForPartsOf <SyntaxNodeVisitor>();
            var doubleQuote = new DoubleQuote(0);

            visitor.VisitDoubleQuote(doubleQuote);
            visitor.Received().VisitSyntaxToken(doubleQuote);
            Assert.Equal(typeof(SyntaxToken), typeof(DoubleQuote).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 static void SpanEndsAtSecondDoubleQuote()
        {
            DoubleQuote quote2;
            var         attribute = new Attribute(
                new AttributeName(10, "language"),
                new Equals(18),
                new DoubleQuote(19),
                new AttributeValue(20, "C#"),
                quote2 = new DoubleQuote(22));

            Assert.Equal(quote2.Span.End, attribute.Span.End);
        }
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;
        }
Beispiel #8
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 VisitDoubleQuoteCallsVisitSyntaxTokenToAllowProcessingAllSyntaxTokensPolymorphically()
 {
     var visitor = Substitute.ForPartsOf<SyntaxNodeVisitor>();
     var doubleQuote = new DoubleQuote(0);
     visitor.VisitDoubleQuote(doubleQuote);
     visitor.Received().VisitSyntaxToken(doubleQuote);
     Assert.Equal(typeof(SyntaxToken), typeof(DoubleQuote).BaseType);
 }
Beispiel #10
0
 public static void SpanEndsAtSecondDoubleQuote()
 {
     DoubleQuote quote2;
     var attribute = new Attribute(
         new AttributeName(10, "language"),
         new Equals(18),
         new DoubleQuote(19),
         new AttributeValue(20, "C#"),
         quote2 = new DoubleQuote(22));
     Assert.Equal(quote2.Span.End, attribute.Span.End);
 }
Beispiel #11
0
 protected internal virtual void VisitDoubleQuote(DoubleQuote node)
 {
     this.VisitSyntaxToken(node);
 }
Beispiel #12
0
 protected internal virtual void VisitDoubleQuote(DoubleQuote node)
 {
     this.VisitSyntaxToken(node);
 }