Example #1
0
 public static void SpanEndReturnsMaxEndOfChildNodes()
 {
     var end = new BlockEnd(40);
     var start = new StatementBlockStart(4);
     var target = new Template(end, start); // intentionally reversed
     Assert.Equal(end.Span.End, target.Span.End);
 }
Example #2
0
 public static void AcceptCallsVisitTemplateMethodOfSyntaxNodeVisitor()
 {
     var visitor = Substitute.For<SyntaxNodeVisitor>();
     var template = new Template();
     template.Accept(visitor);
     visitor.Received().VisitTemplate(template);
 }
Example #3
0
 public static void ChildNodesReturnsNodesSpecifiedInConstructor()
 {
     var start = new StatementBlockStart(0);
     var end = new BlockEnd(2);
     var node = new Template(start, end);
     Assert.Same(start, node.ChildNodes().First());
     Assert.Same(end, node.ChildNodes().Last());
 }
Example #4
0
 public static void PositionReturnsFixedValue()
 {
     var target = new Template();
     Assert.Equal(new Position(0, 0), target.Position);
 }
 public static void VisitTemplateCallsVisitNonterminalNodeToAllowProcessingAllNonterminalNodesPolymorphically()
 {
     var visitor = Substitute.ForPartsOf<SyntaxNodeVisitor>();
     var template = new Template(new StatementBlockStart(0), new BlockEnd(0));
     visitor.VisitTemplate(template);
     visitor.Received().VisitNonterminalNode(template);
     Assert.Equal(typeof(NonterminalNode), typeof(Template).BaseType);
 }
Example #6
0
 public TemplateAnalysis(ITextSnapshot textSnapshot, Template template, IReadOnlyList<TemplateError> errors)
 {
     this.TextSnapshot = textSnapshot;
     this.Template = template;
     this.Errors = errors;
 }
Example #7
0
 protected internal virtual void VisitTemplate(Template node)
 {            
     this.VisitNonterminalNode(node);
 }