private bool LoadPendingCsv(IWebDriver driver, DateTime date, string email) { _logger.Info("Looking for completed transactions"); Temp.EmptyFolder(Config.I.TempDirectory); var futureResult = AirBnbTransactionHistory.DownloadFutureTransaction(driver, date.Year); if (!futureResult) { _logger.Warn(string.Format("{0} doesn't have pending transactions", email)); return(true); } _logger.Info("downloading csv file"); driver.JustWait(5); var pendingTransactionFileName = email + "-airbnb_pending.csv"; var pendingCsvFile = Temp.WaitFotTheFirstFile("*.csv", Config.I.TempDirectory, 1000 * 60 * 5); //TODO: check is file have size 0kb then redo downloading if (pendingCsvFile == null) { _logger.Error("Error during file download"); N.Note("error downloading file"); return(false); } var pendingTransactionsDirPath = Config.I.ExportFutureTransactionsDirectory + @"\Future Transactions - " + date.ToString("MMMM d yyyy") + @"\"; Temp.TouchDirectory(pendingTransactionsDirPath); var pendingCsvFullPath = pendingTransactionsDirPath + @"\" + pendingTransactionFileName; Temp.Move(pendingCsvFile, pendingCsvFullPath); N.Note(pendingTransactionFileName + " downloaded"); _logger.Info(pendingTransactionFileName + " downloaded"); return(true); }