public void SetUp() { DirectoryUtils.ClearDir(_rootPath, true); DownloadDirectories downloadDirectories = new DownloadDirectories(_rootPath); DownloadUrlPrepator downloadUrlPrepator = new DownloadUrlPrepator(_downloadDefinitions); DownloadFilePathPreparator downloadFilePathPreparator = new DownloadFilePathPreparator(_downloadDefinitions, downloadDirectories); DownloadUnzipPathPreparator downloadUnzipPathPreparator = new DownloadUnzipPathPreparator(downloadDirectories); DownloadFilesQueue downloadFilesQueue = new DownloadFilesQueue(); DownloadPipe downloadPipe = new DownloadPipe(new WebClientFileDownloader(), new SystemFileUnzipper(), downloadFilesQueue); TestObj = new DataFileDownloader(downloadPipe, downloadFilesQueue, downloadUrlPrepator, downloadFilePathPreparator, downloadUnzipPathPreparator); }
public static IDataPump Get(DataPumpType dataPumpType, IDataPumpProvider dataPumpProvider, string downloadPath) { Dictionary <StockType, DataPumpDownloadDefinition> downloadDefinitions = dataPumpProvider.GetDownloadDefinitions(); DownloadDirectories downloadDirectories = new DownloadDirectories(downloadPath); DownloadUrlPrepator downloadUrlPrepator = new DownloadUrlPrepator(downloadDefinitions); DownloadFilePathPreparator downloadFilePathPreparator = new DownloadFilePathPreparator(downloadDefinitions, downloadDirectories); DownloadUnzipPathPreparator downloadUnzipPathPreparator = new DownloadUnzipPathPreparator(downloadDirectories); DownloadFilesQueue downloadFilesQueue = new DownloadFilesQueue(); DownloadPipe downloadPipe = new DownloadPipe(new WebClientFileDownloader(), new SystemFileUnzipper(), downloadFilesQueue); IDataFileDownloader dataFileDownloader = new DataFileDownloader(downloadPipe, downloadFilesQueue, downloadUrlPrepator, downloadFilePathPreparator, downloadUnzipPathPreparator); IDataPumpStockDataToDBWriter stockDataToDBWriter = new DataPumpStockDataToDBWriter(dataPumpProvider, new InsertCommandGenerator(dataPumpProvider)); IDataFileIterator dataFileIterator = new DailyDataFileIterator(); IDataFileLineToStockData lineToStockData = new DailyDataFileLineToStockData(); return(new Bossa.DataPump(dataPumpProvider, dataFileIterator, stockDataToDBWriter, lineToStockData, dataFileDownloader, downloadDirectories)); }
public void SetUp() { DirectoryUtils.ClearDir(_rootPath, true); _downloadDirectories = new DownloadDirectories(_rootPath); TestObj = new DownloadUnzipPathPreparator(_downloadDirectories); }