Ejemplo n.º 1
0
 public static void AcceptCallsVisitAttributeMethodOfSyntaxNodeVisitor()
 {
     var visitor = Substitute.For<SyntaxNodeVisitor>();
     var attribute = new Attribute(new AttributeName(0, string.Empty), new Equals(0), new DoubleQuote(0), new AttributeValue(0, string.Empty), new DoubleQuote(0));
     attribute.Accept(visitor);
     visitor.Received().VisitAttribute(attribute);
 }
Ejemplo n.º 2
0
 public static void VisitAttributeCallsVisitNonterminalNodeToAllowProcessingAllNonterminalNodesPolymorphically()
 {
     var visitor = Substitute.ForPartsOf<SyntaxNodeVisitor>();
     var attribute = new Attribute(new AttributeName(0, "attribute"), new Equals(0), new DoubleQuote(0), new AttributeValue(0, string.Empty), new DoubleQuote(0));
     visitor.VisitAttribute(attribute);
     visitor.Received().VisitNonterminalNode(attribute);
     Assert.Equal(typeof(NonterminalNode), typeof(Attribute).BaseType);
 }
Ejemplo n.º 3
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()));
 }
Ejemplo n.º 4
0
 public static void SpanStartsAtName()
 {
     AttributeName name;
     var attribute = new Attribute(
         name = new AttributeName(10, "language"), 
         new Equals(18), 
         new DoubleQuote(19), 
         new AttributeValue(20, "C#"), 
         new DoubleQuote(22));
     Assert.Equal(name.Span.Start, attribute.Span.Start);
 }
Ejemplo n.º 5
0
 protected internal override void VisitAttribute(Attribute node)
 {
     this.currentAttribute = node;
     base.VisitAttribute(node);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 7
0
 public static void ValueReturnsTextOfAttributeValue()
 {
     var attribute = new Attribute(new AttributeName(0, "language"), new Equals(8), new DoubleQuote(9), new AttributeValue(10, "C#"), new DoubleQuote(12));
     Assert.Equal("C#", attribute.Value);
 }
Ejemplo n.º 8
0
 public static void PositionReturnsPositionOfAttributeName()
 {
     var attribute = new Attribute(new AttributeName(0, "language", new Position(4, 2)), new Equals(8), new DoubleQuote(9), new AttributeValue(10, "C#"), new DoubleQuote(12));
     Assert.Equal(new Position(4, 2), attribute.Position);
 }
Ejemplo n.º 9
0
 public static void KindReturnsAttributeSyntaxKind()
 {
     var attribute = new Attribute(new AttributeName(0, "language"), new Equals(8), new DoubleQuote(9), new AttributeValue(10, "C#"), new DoubleQuote(12));
     Assert.Equal(SyntaxKind.Attribute, attribute.Kind);
 }
Ejemplo n.º 10
0
 protected internal virtual void VisitAttribute(Attribute node)
 {
     this.VisitNonterminalNode(node);
 }
Ejemplo n.º 11
0
 protected internal override void VisitAttribute(Attribute node)
 {
     this.currentAttribute = node;
     base.VisitAttribute(node);
 }