private void PrintOutIdDiffs() { var EdtIds = EdtDocumentRepository.GetDocumentNumbers(); var IdxIds = new IdxDocumentsRepository().GetDocumentIds(); var edtExceptIdx = EdtIds.Except(IdxIds); var IdxExceptEdt = IdxIds.Except(EdtIds); using (var sw = new StreamWriter($"{Settings.ReportingDirectory}\\DocumentCountDifferences_IdLists.csv")) { sw.WriteLine("In Edt but not in Idx:"); foreach (var id in edtExceptIdx) { sw.WriteLine(id); } sw.WriteLine("In Idx but not Edt"); foreach (var id in IdxExceptEdt) { sw.WriteLine(id); } } TestLogger.Info( $"Document Id differences output to <a href=\"DocumentCountDifferences_IdLists.csv\"> DocumentCountDifferences_IdLists.csv</a>"); }
public void AnalyseIdx() { var logger = HtmlReport.Writer.CreateTest("Validation Setup", "Processing Idx into local store for reconciliation tests against IdX"); try { logger.Debug("Analysing Standard Mappings"); StandardMappings = new StandardMapReader().GetStandardMappings().Where(x => !string.IsNullOrEmpty(x.EdtName) && !string.IsNullOrEmpty(x.IdxName)); if (!StandardMappings.Any()) { throw new Exception("Failed to read mappings - count is 0 post attempt"); } var idxPath = Settings.IdxFilePath; Document[] documents; IdxDocumentsRepository = new IdxDocumentsRepository(); IdxDocumentsRepository.Initialise(true); logger.Debug("Reading Idx chunks"); do { documents = IdxProcessingService.GetNextDocumentChunkFromFile(idxPath).ToArray(); if (!documents.Any()) { return; } IdxDocumentsRepository.AddDocuments(documents); IdxDocumentsProcessed = +documents.Length; } while (documents.Length > 0); logger.Debug("Completed reading Idx"); IdxDocumentsRepository.CreateDocumentIdIndex(); logger.Pass("Idx pre reading completed"); HtmlReport.Writer.Flush(); } catch (Exception ex) { logger.Log(AventStack.ExtentReports.Status.Info, ex.Message); logger.Log(AventStack.ExtentReports.Status.Info, ex.StackTrace); if (ex.InnerException != null) { logger.Log(AventStack.ExtentReports.Status.Info, ex.InnerException.Message); logger.Log(AventStack.ExtentReports.Status.Info, ex.InnerException.StackTrace); } logger.Fail("Failed to analyse Idx"); HtmlReport.Writer.Flush(); throw ex; } }
public void DoesHaveExpectedColumnCount() { var idxCount = new IdxDocumentsRepository().GetColumnSizeOfDocuments(); TestContext.Out.WriteLine($"Idx column total: {idxCount}"); var loadFileColumnCount = new ConversionLoadFileRepository().GetColumnSizeOfDocuments(); TestContext.Out.WriteLine($"Conversion Tool Load File column count: {loadFileColumnCount}"); Assert.AreEqual(idxCount, loadFileColumnCount, "File counts should be equal for Idx and Load file"); }
public void DoesHaveExpectedDocumentCount() { var idxDocumentCount = new IdxDocumentsRepository().GetNumberOfDocuments(); TestContext.Out.WriteLine($"Idx document count: {idxDocumentCount}"); var loadFileDocumentCount = new ConversionLoadFileRepository().GetNumberOfDocuments(); TestContext.Out.WriteLine($"Conversion Tool Load File document count: {loadFileDocumentCount}"); Assert.AreEqual(idxDocumentCount, loadFileDocumentCount, "File counts should be equal for Idx and Load file"); }
public void NativeCountsAreEqualBetweenIdxAndQuarantineFolder() { int lppDocCount = EdtDocumentRepository.GetDocumentQuarantineDocumentCount(); int idxLppDocCount = new IdxDocumentsRepository().GetNumberOfLppDocs(); string[][] data = { new[] { "Item Evaluated", "Count of LPP Documents" }, new[] { "Idx file", idxLppDocCount.ToString() }, new[] { "Quarantine Folder", lppDocCount.ToString() } }; TestLogger.Log(AventStack.ExtentReports.Status.Info, MarkupHelper.CreateTable(data)); Assert.AreEqual(lppDocCount, idxLppDocCount, "File counts should be equal between IDX and EDT Quarantine folder"); }