Example #1
0
        public void CanParseDiff()
        {
            List <DiffLine> result = DiffParser.ParseDiff(c_ExampleDiff);

            foreach (var l in result)
            {
                Log(l.ToString());
            }
        }
Example #2
0
        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));
            }
        }
Example #3
0
        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);
                }
            }
        }