public void ExportReports() { reader.GetReports("/SSRSMigrate_AW_Tests", GetReports_Reporter); foreach (ReportItem actualReportItem in actualReportItems) { string saveFilePath = outputPath + SSRSUtil.GetServerPathToPhysicalPath(actualReportItem.Path, "rdl"); ExportStatus actualStatus = reportExporter.SaveItem( actualReportItem, saveFilePath, true); // Export was successful Assert.True(actualStatus.Success, string.Format("Success; {0}", actualReportItem.Path)); // Exported to the expected location Assert.AreEqual(saveFilePath, actualStatus.ToPath, string.Format("ToPath; {0}", actualReportItem.Path)); // Was exported from the expected location Assert.AreEqual(actualReportItem.Path, actualStatus.FromPath, string.Format("ToPath; {0}", actualReportItem.Path)); // The exported ReportItem exists on disk Assert.True(File.Exists(actualStatus.ToPath)); } // The exported reports file matches the expected file Assert.True(TesterUtility.CompareTextFiles(testReportFiles[0], outputPath + "\\SSRSMigrate_AW_Tests\\Reports\\Company Sales.rdl")); Assert.True(TesterUtility.CompareTextFiles(testReportFiles[1], outputPath + "\\SSRSMigrate_AW_Tests\\Reports\\Sales Order Detail.rdl")); Assert.True(TesterUtility.CompareTextFiles(testReportFiles[2], outputPath + "\\SSRSMigrate_AW_Tests\\Reports\\Store Contacts.rdl")); }
public void ExportReportItem() { string filePath = outputPath + SSRSUtil.GetServerPathToPhysicalPath(reportItem_CompanySales.Path, "rdl"); ExportStatus actualStatus = exporter.SaveItem(reportItem_CompanySales, filePath); Assert.True(actualStatus.Success); Assert.AreEqual(filePath, actualStatus.ToPath); Assert.True(File.Exists(actualStatus.ToPath)); Assert.Null(actualStatus.Errors); Assert.True(TesterUtility.CompareTextFiles(Path.Combine(TestContext.CurrentContext.TestDirectory, testReportFiles[0]), actualStatus.ToPath)); }
public void ExportReportItems() { for (int i = 0; i < reportItems.Count(); i++) { ReportItem reportItem = reportItems[i]; string filePath = outputPath + SSRSUtil.GetServerPathToPhysicalPath(reportItem.Path, "rdl"); ExportStatus actualStatus = exporter.SaveItem(reportItem, filePath); Assert.True(actualStatus.Success, "Success"); Assert.AreEqual(filePath, actualStatus.ToPath, "ToPath"); Assert.True(File.Exists(actualStatus.ToPath), " ToPath.Exists"); Assert.Null(actualStatus.Errors); Assert.True(TesterUtility.CompareTextFiles(Path.Combine(TestContext.CurrentContext.TestDirectory, testReportFiles[i]), actualStatus.ToPath), "CompareTextFiles"); } }