Beispiel #1
0
        public void GetReports()
        {
            string path = "/SSRSMigrate_AW_Tests";

            var actual = reader.GetReports(path);

            Assert.AreEqual(expectedReportItems.Count(), actual.Count());
        }
        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"));
        }