public static void Check_BeforeAfterInsertionBatched()
        {
            Paths paths = new Paths(sampleRoot, resultRoot, sampleRoot + Path.DirectorySeparatorChar + "Programs" + Path.DirectorySeparatorChar + "Simple.pgm", new Multipass.IndexNames());
            TestUnit unit = new TestUnit(new Multipass(paths));
            unit.Init(new[] { "*.pgm", "*.cpy" });
            unit.Parse();

            var e = updateLine(TextChangeType.LineInserted, 2, "END PROGRAM Simple.");
            e = updateLine(TextChangeType.LineUpdated, 1, "PROGRAM-ID. Simpler.", e);

            // clear document
            unit.Compiler.CompilationResultsForProgram.UpdateTextLines(e);
            unit.Parse();

            var names = unit.Comparator.paths.Resultnames as Multipass.IndexNames;
            names.index = 2;
            Console.WriteLine("Compare with result file: "+unit.Comparator.paths.Result);
            unit.Compare();//with Simple.2.txt
        }
        public static void Check_BeforeAfterInsertion()
        {
            Paths paths = new Paths(sampleRoot, resultRoot, sampleRoot + Path.DirectorySeparatorChar + "Programs" + Path.DirectorySeparatorChar + "Simple.pgm", new Multipass.IndexNames());
            TestUnit unit = new TestUnit(new Multipass(paths));
            unit.Init(new[] { "*.pgm", "*.cpy" });
            unit.Parse();
            var names = unit.Comparator.paths.Resultnames as Multipass.IndexNames;
            names.index = 0;
            unit.Compare();//with Simple.0.txt

            // explicitely close program by adding END PROGRAM line
            var e2 = updateLine(TextChangeType.LineInserted, 2, "END PROGRAM Simple.");
            var e = updateLine(TextChangeType.LineUpdated, 1, "  PROGRAM-ID. Simple.");
            e.TextChanges.Add(e2.TextChanges[0]);
            unit.Compiler.CompilationResultsForProgram.UpdateTextLines(e);
            unit.Parse();
            names.index++;
            Console.WriteLine("Compare with result file: "+unit.Comparator.paths.Result);
            unit.Compare();//with Simple.1.txt

            // change program name ; now first and last line have differing program id
            e = updateLine(TextChangeType.LineUpdated, 1, "PROGRAM-ID. Simpler.");
            unit.Compiler.CompilationResultsForProgram.UpdateTextLines(e);
            unit.Parse();
            names.index++;
            Console.WriteLine("Compare with result file: "+unit.Comparator.paths.Result);
            unit.Compare();//with Simple.2.txt

            // clear document
            e = updateLine(TextChangeType.DocumentCleared, /* the following parameters are not used when DocumentCleared*/ 0, null);
            unit.Compiler.CompilationResultsForProgram.UpdateTextLines(e);
            unit.Parse();
            names.index++;
            Console.WriteLine("Compare with result file: "+unit.Comparator.paths.Result);
            unit.Compare();//with Simple.3.txt
        }
 public ProgramsComparator(Paths path, bool debug = false)
     : base(path, debug)
 {
 }
 public Outputter(Paths path, bool debug = false)
     : base(path, debug)
 {
 }
 public NYComparator(Paths path, bool debug = false)
     : base(path, debug)
 {
 }
 public Multipass(Paths path, bool debug = false)
     : base(path, debug)
 {
 }
 public ArithmeticComparator(Paths path, bool debug = false)
     : base(path, debug)
 {
 }
        private IList<FilesComparator> GetComparators(string sampleRoot, string resultsRoot, string samplePath, bool debug)
        {
            IList<FilesComparator> comparators = new List<FilesComparator>();
            foreach (var names in Names)
            {

                //var paths = new Paths(sample, names);
                //paths.sextension = extensions[0];
                Paths path =new Paths(sampleRoot, resultsRoot, samplePath, names);
                if (System.IO.File.Exists(path.Result))
                {
                    Type type = names.GetComparatorType();
                    System.Reflection.ConstructorInfo constructor = type.GetConstructor(new[] { typeof(Paths), typeof(bool) });
                    comparators.Add((FilesComparator)constructor.Invoke(new object[] { path, debug }));
                }
            }
            return comparators;
        }
 public FilesComparator(Paths path, bool debug = false)
 {
     paths = path;
     this.debug = debug;
 }