private void ExportToDisk_Connection() { // Save configuration this.Save_SourceConfiguration(); IReportServerReader reader = null; DataSourceItemExporter dataSourceExporter = null; FolderItemExporter folderExporter = null; ReportItemExporter reportExporter = null; // Test the source connection this.TestSourceConnection(true); string version = this.GetSourceServerVersion(); reader = this.mKernel.Get <IReportServerReader>(version); dataSourceExporter = this.mKernel.Get <DataSourceItemExporter>(); folderExporter = this.mKernel.Get <FolderItemExporter>(); reportExporter = this.mKernel.Get <ReportItemExporter>(); this.PerformExportToDisk(this.txtSrcPath.Text, this.txtExportDiskFolderName.Text, reader, folderExporter, reportExporter, dataSourceExporter); }
private void ExportToZip_Connection() { // Save configuration this.Save_SourceConfiguration(); IReportServerReader reader = null; DataSourceItemExporter dataSourceExporter = null; FolderItemExporter folderExporter = null; ReportItemExporter reportExporter = null; IBundler zipBundler = null; IFileSystem fileSystem = null; // Test the source connection this.TestSourceConnection(true); string version = this.GetSourceServerVersion(); reader = this.mKernel.Get <IReportServerReader>(version); dataSourceExporter = this.mKernel.Get <DataSourceItemExporter>(); folderExporter = this.mKernel.Get <FolderItemExporter>(); reportExporter = this.mKernel.Get <ReportItemExporter>(); zipBundler = this.mKernel.Get <IBundler>(); fileSystem = this.mKernel.Get <IFileSystem>(); this.PerformExportToZip(this.txtSrcPath.Text, this.txtExportZipFilename.Text, reader, folderExporter, reportExporter, dataSourceExporter, zipBundler, fileSystem); }
public void Constructor_Succeed() { var logger = new MockLogger(); FolderItemExporter dataSourceExporter = new FolderItemExporter(exportWriterMock.Object, logger); Assert.NotNull(dataSourceExporter); }
public ExportDiskForm(string sourceRootPath, string destinationPath, IReportServerReader reader, FolderItemExporter folderExporter, ReportItemExporter reportExporter, DataSourceItemExporter dataSourceExporter, ILoggerFactory loggerFactory) { if (string.IsNullOrEmpty(sourceRootPath)) { throw new ArgumentException("sourceRootPath"); } if (string.IsNullOrEmpty(destinationPath)) { throw new ArgumentException("destinationPath"); } if (reader == null) { throw new ArgumentNullException("reader"); } if (folderExporter == null) { throw new ArgumentNullException("folderExporter"); } if (reportExporter == null) { throw new ArgumentNullException("reportExporter"); } if (dataSourceExporter == null) { throw new ArgumentNullException("dataSourceExporter"); } if (loggerFactory == null) { throw new ArgumentNullException("loggerFactory"); } InitializeComponent(); this.mSourceRootPath = sourceRootPath; this.mExportDestinationPath = destinationPath; this.mReportServerReader = reader; this.mFolderExporter = folderExporter; this.mReportExporter = reportExporter; this.mDataSourceExporter = dataSourceExporter; this.mLoggerFactory = loggerFactory; this.mLogger = mLoggerFactory.GetCurrentClassLogger(); this.mSummaryForm = new SummaryForm(); }
public void Constructor_NullIExportWriter() { ArgumentNullException ex = Assert.Throws<ArgumentNullException>( delegate { FolderItemExporter dataSourceExporter = new FolderItemExporter(null); }); Assert.That(ex.Message, Is.EqualTo("Value cannot be null.\r\nParameter name: exportWriter")); }
public ExportZipForm(string sourceRootPath, string destinationFilename, IReportServerReader reader, FolderItemExporter folderExporter, ReportItemExporter reportExporter, DataSourceItemExporter dataSourceExporter, IBundler zipBundler, ILoggerFactory loggerFactory, IFileSystem fileSystem) { if (string.IsNullOrEmpty(sourceRootPath)) throw new ArgumentException("sourceRootPath"); if (string.IsNullOrEmpty(destinationFilename)) throw new ArgumentException("destinationFilename"); if (reader == null) throw new ArgumentNullException("reader"); if (folderExporter == null) throw new ArgumentNullException("folderExporter"); if (reportExporter == null) throw new ArgumentNullException("reportExporter"); if (dataSourceExporter == null) throw new ArgumentNullException("dataSourceExporter"); if (zipBundler == null) throw new ArgumentNullException("zipBundler"); if (loggerFactory == null) throw new ArgumentNullException("loggerFactory"); if (fileSystem == null) throw new ArgumentNullException("fileSystem"); InitializeComponent(); this.mSourceRootPath = sourceRootPath; this.mExportDestinationFilename = destinationFilename; this.mReportServerReader = reader; this.mFolderExporter = folderExporter; this.mReportExporter = reportExporter; this.mDataSourceExporter = dataSourceExporter; this.mZipBundler = zipBundler; this.mLoggerFactory = loggerFactory; this.mFileSystem = fileSystem; this.mLogger = mLoggerFactory.GetCurrentClassLogger(); this.mExportOutputTempDirectory = this.GetTemporaryExportOutputFolder("SSRSMigrate_ExportZip"); this.CreateExportOutputFolder(this.mExportOutputTempDirectory); this.mSummaryForm = new SummaryForm(); }
public void Constructor_NullIExportWriter() { var logger = new MockLogger(); ArgumentNullException ex = Assert.Throws <ArgumentNullException>( delegate { FolderItemExporter dataSourceExporter = new FolderItemExporter(null, logger); }); Assert.That(ex.Message, Is.EqualTo("Value cannot be null.\r\nParameter name: exportWriter")); }
public void TestFixtureSetUp() { EnvironmentSetup(); outputPath = GetOutPutPath(); SetupExpectedValues(); // Create the IItemExporter objects reportExporter = TestKernel.Instance.Get <ReportItemExporter>(); dataSourceExporter = TestKernel.Instance.Get <DataSourceItemExporter>(); folderExporter = TestKernel.Instance.Get <FolderItemExporter>(); reader = TestKernel.Instance.Get <IReportServerReader>("2005-SRC"); }
private void PerformExportToDisk(string sourceRootPath, string destinationPath, IReportServerReader reader, FolderItemExporter folderExporter, ReportItemExporter reportExporter, DataSourceItemExporter dataSourceExporter) { ExportDiskForm exportDiskForm = new ExportDiskForm(sourceRootPath, destinationPath, reader, folderExporter, reportExporter, dataSourceExporter, this.mLoggerFactory); exportDiskForm.DebugForm = this.mDebugForm; exportDiskForm.Show(); }
public ExportDiskForm(string sourceRootPath, string destinationPath, IReportServerReader reader, FolderItemExporter folderExporter, ReportItemExporter reportExporter, DataSourceItemExporter dataSourceExporter, ILoggerFactory loggerFactory) { if (string.IsNullOrEmpty(sourceRootPath)) throw new ArgumentException("sourceRootPath"); if (string.IsNullOrEmpty(destinationPath)) throw new ArgumentException("destinationPath"); if (reader == null) throw new ArgumentNullException("reader"); if (folderExporter == null) throw new ArgumentNullException("folderExporter"); if (reportExporter == null) throw new ArgumentNullException("reportExporter"); if (dataSourceExporter == null) throw new ArgumentNullException("dataSourceExporter"); if (loggerFactory == null) throw new ArgumentNullException("loggerFactory"); InitializeComponent(); this.mSourceRootPath = sourceRootPath; this.mExportDestinationPath = destinationPath; this.mReportServerReader = reader; this.mFolderExporter = folderExporter; this.mReportExporter = reportExporter; this.mDataSourceExporter = dataSourceExporter; this.mLoggerFactory = loggerFactory; this.mLogger = mLoggerFactory.GetCurrentClassLogger(); this.mSummaryForm = new SummaryForm(); }
public void TestFixtureSetUp() { expectedFolderItem = new FolderItem() { Name = "Reports", Path = "/SSRSMigrate_AW_Tests/Reports", }; exportWriterMock = new Mock <IExportWriter>(); var logger = new MockLogger(); exportWriterMock.Setup(e => e.Save(It.IsAny <string>(), It.IsAny <string>(), true)); // Mock IExporter.Save where the directory exists but overwrite = false exportWriterMock.Setup(e => e.Save(expectedFolderItemFileName, false)) .Throws(new IOException(string.Format("Directory '{0}' already exists.", expectedFolderItemFileName))); exporter = new FolderItemExporter(exportWriterMock.Object, logger); }
private void PerformExportToZip(string sourceRootPath, string destinationFilename, IReportServerReader reader, FolderItemExporter folderExporter, ReportItemExporter reportExporter, DataSourceItemExporter dataSourceExporter, IBundler zipBunder, IFileSystem fileSystem) { ExportZipForm exportZipForm = new ExportZipForm( sourceRootPath, destinationFilename, reader, folderExporter, reportExporter, dataSourceExporter, zipBunder, this.mLoggerFactory, fileSystem); exportZipForm.DebugForm = this.mDebugForm; exportZipForm.Show(); }
public void TestFixtureSetUp() { EnvironmentSetup(); var settings = new NinjectSettings() { LoadExtensions = false }; kernel = new StandardKernel( settings, new Log4NetModule(), new DependencyModule()); exporter = kernel.Get <FolderItemExporter>(); folderItems = new List <FolderItem>() { new FolderItem() { Name = "Reports", Path = "/SSRSMigrate_AW_Tests/Reports", }, new FolderItem() { Name = "Sub Folder", Path = "/SSRSMigrate_AW_Tests/Reports/Sub Folder", }, new FolderItem() { Name = "Data Sources", Path = "/SSRSMigrate_AW_Tests/Data Sources", } }; outputPath = GetOutPutPath(); }
public void TestFixtureSetUp() { EnvironmentSetup(); var settings = new NinjectSettings() { LoadExtensions = false }; kernel = new StandardKernel( settings, new Log4NetModule(), new DependencyModule()); exporter = kernel.Get<FolderItemExporter>(); folderItems = new List<FolderItem>() { new FolderItem() { Name = "Reports", Path = "/SSRSMigrate_AW_Tests/Reports", }, new FolderItem() { Name = "Sub Folder", Path = "/SSRSMigrate_AW_Tests/Reports/Sub Folder", }, new FolderItem() { Name = "Data Sources", Path = "/SSRSMigrate_AW_Tests/Data Sources", } }; outputPath = GetOutPutPath(); }
public ExportZipForm(string sourceRootPath, string destinationFilename, IReportServerReader reader, FolderItemExporter folderExporter, ReportItemExporter reportExporter, DataSourceItemExporter dataSourceExporter, IBundler zipBundler, ILoggerFactory loggerFactory, IFileSystem fileSystem) { if (string.IsNullOrEmpty(sourceRootPath)) { throw new ArgumentException("sourceRootPath"); } if (string.IsNullOrEmpty(destinationFilename)) { throw new ArgumentException("destinationFilename"); } if (reader == null) { throw new ArgumentNullException("reader"); } if (folderExporter == null) { throw new ArgumentNullException("folderExporter"); } if (reportExporter == null) { throw new ArgumentNullException("reportExporter"); } if (dataSourceExporter == null) { throw new ArgumentNullException("dataSourceExporter"); } if (zipBundler == null) { throw new ArgumentNullException("zipBundler"); } if (loggerFactory == null) { throw new ArgumentNullException("loggerFactory"); } if (fileSystem == null) { throw new ArgumentNullException("fileSystem"); } InitializeComponent(); this.mSourceRootPath = sourceRootPath; this.mExportDestinationFilename = destinationFilename; this.mReportServerReader = reader; this.mFolderExporter = folderExporter; this.mReportExporter = reportExporter; this.mDataSourceExporter = dataSourceExporter; this.mZipBundler = zipBundler; this.mLoggerFactory = loggerFactory; this.mFileSystem = fileSystem; this.mLogger = mLoggerFactory.GetCurrentClassLogger(); this.mExportOutputTempDirectory = this.GetTemporaryExportOutputFolder("SSRSMigrate_ExportZip"); this.CreateExportOutputFolder(this.mExportOutputTempDirectory); this.mSummaryForm = new SummaryForm(); }
public void Constructor_Succeed() { FolderItemExporter dataSourceExporter = new FolderItemExporter(exportWriterMock.Object); Assert.NotNull(dataSourceExporter); }
public void TestFixtureSetUp() { expectedFolderItem = new FolderItem() { Name = "Reports", Path = "/SSRSMigrate_AW_Tests/Reports", }; exportWriterMock = new Mock<IExportWriter>(); exportWriterMock.Setup(e => e.Save(It.IsAny<string>(), It.IsAny<string>(), true)); // Mock IExporter.Save where the directory exists but overwrite = false exportWriterMock.Setup(e => e.Save(expectedFolderItemFileName, false)) .Throws(new IOException(string.Format("Directory '{0}' already exists.", expectedFolderItemFileName))); exporter = new FolderItemExporter(exportWriterMock.Object); }
public void TestFixtureSetUp() { EnvironmentSetup(); outputPath = GetOutPutPath(); SetupExpectedValues(); // Create the IItemExporter objects reportExporter = TestKernel.Instance.Get<ReportItemExporter>(); dataSourceExporter = TestKernel.Instance.Get<DataSourceItemExporter>(); folderExporter = TestKernel.Instance.Get<FolderItemExporter>(); reader = TestKernel.Instance.Get<IReportServerReader>("2005-SRC"); }