public void CanParseDiff() { List <DiffLine> result = DiffParser.ParseDiff(c_ExampleDiff); foreach (var l in result) { Log(l.ToString()); } }
public void CanVisitDiff() { List <DiffLine> result = DiffParser.ParseDiff(c_ExampleDiff); var visitor = new LineVisitorContext(); foreach (var l in result) { l.Accept(visitor); Trace.WriteLine(string.Format("{0} {1} {2}", visitor.CurrentNewFile, visitor.CurrentNewFileLineNumber, visitor.CurrentLineText ?? visitor.CurrentFunctionName ?? visitor.CurrentContext)); } }
private IEnumerable <DiffComment> Review(string diff) { var parsedDiff = DiffParser.ParseDiff(diff); foreach (var reviewerCreator in m_Reviewers) { var reviewer = reviewerCreator(); foreach (var comment in reviewer.Review(parsedDiff)) { yield return(comment); } } }