public void TestTimeLoggerRepositoryFactory() { var repo1 = _timeLoggerRepositoryFactory.Create("engineer1_timelog_202003.csv"); var allLogEntries1 = repo1.GetAllLogEntries(); Assert.IsNotEmpty(allLogEntries1, "engineer1_timelog_202003.csv is read properly"); var repo2 = _timeLoggerRepositoryFactory.Create("engineer2iscopyof1_timelog_202003.csv"); var allLogEntries2 = repo2.GetAllLogEntries(); Assert.IsNotEmpty(allLogEntries2, "engineer2iscopyof1_timelog_202003.csv is read properly"); }
private List<ManualTimeLogger.Persistence.IRepository> GetAllTimeLogRepositories() { var allTimeLogFileNames = Directory.EnumerateFiles(_timeLogRepositoryFactory.GetFilesBasePath()); var allTimeLogRepositories = allTimeLogFileNames.Select(filePath => _timeLogRepositoryFactory.Create(Path.GetFileName(filePath))).ToList(); return allTimeLogRepositories; }