Ejemplo n.º 1
0
        public void PrepareForComparison()
        {
            perfCounter.Start();
            var masterFileContent = FileReader.ReadFile(FileConfiguration.PathMasterFile, FileConfiguration.RowsToSkip, FileConfiguration.Encoding);
            var testFileContent   = FileReader.ReadFile(FileConfiguration.PathTestFile, FileConfiguration.RowsToSkip, FileConfiguration.Encoding);

            perfCounter.Stop("Read two init files");

            perfCounter.Start();
            var exceptedMasterData = Except(masterFileContent, testFileContent);
            var exceptedTestData   = Except(testFileContent, masterFileContent);

            perfCounter.Stop("Except files");

            IWorkTable masterTable = new WorkTable("Master");
            IWorkTable testTable   = new WorkTable("Test");

            if (exceptedMasterData.Any() && exceptedTestData.Any())
            {
                perfCounter.Start();
                masterTable.LoadData(exceptedMasterData, FileConfiguration.Delimiter, FileConfiguration.IsHeadersExist);
                testTable.LoadData(exceptedTestData, FileConfiguration.Delimiter, FileConfiguration.IsHeadersExist);
                perfCounter.Stop("Load two files to WorkTable");
                ComparisonProcessor comparisonProcessor = new ComparisonProcessor(perfCounter);
                comparisonProcessor.Execute(masterTable, testTable);
                FillSummary(comparisonProcessor);
            }
            else
            {
                perfCounter.SaveAllResults();
            }
        }
Ejemplo n.º 2
0
 private void FillSummary(ComparisonProcessor comparisonProcessor)
 {
     MasterRowsCount   = comparisonProcessor.MasterRowsCount;
     TestRowsCount     = comparisonProcessor.TestRowsCount;
     ActualRowsDiff    = comparisonProcessor.ActualRowsDiff;
     ComparedRowsCount = comparisonProcessor.ComparedRowsCount;
     ExtraRowsCount    = comparisonProcessor.ExtraRowsCount;
 }