public void SearchCSVFileTestMethod() { var baseDirectory = ConfigurationManager.AppSettings.Get("AssessmentBaseDirectory"); if (string.IsNullOrEmpty(baseDirectory)) { Assert.Fail(); } var searchFiles = _iCSVFileManager.SearchCSVFile(baseDirectory); Assert.IsTrue(searchFiles == null || searchFiles?.Count > 0, "Method _iCSVFileManager.SearchCSVFile(baseDirectory) failed"); }
/// <summary> /// Get list of customer address from .csv files /// </summary> /// <returns>List of customer addresse</returns> public List <CustomerAddress> GetCustomerAddresses() { var customerAddresses = new List <CustomerAddress>(); var rootDirectory = ConfigurationManager.AppSettings.Get("AssessmentBaseDirectory"); var files = _csvFileManager.SearchCSVFile(rootDirectory); foreach (var filePath in files) { if (_csvFileManager.CheckFileSize(filePath)) { var filecontents = _csvFileManager.ReadCSVFile(filePath); customerAddresses.AddRange(ExtractCustomerAddressFromCsvFile(filecontents)); } } return(customerAddresses); }