コード例 #1
0
        public void Close__ClosesDataFile()
        {
            DailyDataFileIterator obj = new DailyDataFileIterator();

            obj.Open(_testFilePath);
            CheckTestFileOpened().ShouldBeTrue();
            obj.Close();
            CheckTestFileOpened().ShouldBeFalse();
            TestObj.PreviousLine().ShouldBeNullOrEmpty();
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 public void SetUp()
 {
     TestObj = new DailyDataFileIterator();
 }