public CsvParserLogic( ICsvParserService csvParserService, ILogger <CsvParserLogic> logger) { CsvParserService = csvParserService; Logger = logger; }
public void Should_Return_Null_For_Invalid_Urls_Or_Without_Csv_Extension() { ICsvParserService csvParserService = Substitute.For <ICsvParserService>(); ILogger <CsvParserLogic> logger = Substitute.For <ILogger <CsvParserLogic> >(); ICsvParserLogic csvParserLogic = new CsvParserLogic(csvParserService, logger); IEnumerable <string> invalidUrls; using (Stream stream = new MemoryStream()) { csvParserService.ParseCsvAsync(Arg.Any <string>(), Arg.Any <OutputFormats>()).Returns(Task.FromResult(stream)); invalidUrls = GetInvalidUrls(); foreach (string url in invalidUrls) { Stream result = csvParserLogic.ParseCsvAsync(url, OutputFormats.json).Result; Assert.Null(result); } IEnumerable <string> validUrls = GetValidUrls(); foreach (string url in validUrls) { Stream result = csvParserLogic.ParseCsvAsync(url, OutputFormats.json).Result; Assert.NotNull(result); } } }
public ServiceRunner( ICsvParserService parserService, IEsvBibleContext esvBibleContext) { _parserService = parserService; _esvBibleContext = esvBibleContext; }
public FileController(IXmlParserService xmlParserService, ICsvParserService csvParserService, ITransactionService transactionService, IMapper mapper) { _xmlParserService = xmlParserService; _csvParserService = csvParserService; _transactionService = transactionService; _mapper = mapper; }
public FileProcessHandler(ICsvParserService csvParserService, INormalizationService normalizationService, IDataStorageRepository dataStorageRepository, ILogger <FileProcessHandler> logger) { _csvParserService = csvParserService; _normalizationService = normalizationService; _dataStorageRepository = dataStorageRepository; _logger = logger; }
public BookService(GoodBooksContext context, ICsvParserService csvParserService, IMapper mapper, IElasticClient elasticClient, ILogger <BookService> logger) { this.context = context; this.csvParserService = csvParserService; this.mapper = mapper; this.elasticClient = elasticClient; this.logger = logger; }
public ImportExportViewModel(ICsvParserService parserService) { _parserService = parserService; ExportCommand = new Command(() => { ImportExportText = parserService.StringifyMemories(_existingMemories); }); ImportCommand = new Command(async() => { await ImportAsync(); }); }
public Program(IParametersService parametersService, IConnectionTestService connectionTestService, ICsvImporterService csvImporterService, ICsvParserService csvParserService, IResultWriterService resultWriterService, ICsvWriterService csvWriterService, IDestroyObjectService destroyObjectService, IFindObjectsService findObjectsService, IClassesService classesService, IObjectTypeService objectTypeService) { this.ParametersService = parametersService; this.ConnectionTestService = connectionTestService; this.CsvImporterService = csvImporterService; this.CsvParserService = csvParserService; this.ResultWriterService = resultWriterService; this.CsvWriterService = csvWriterService; this.DestroyObjectService = destroyObjectService; this.ClassesService = classesService; this.FindObjectsService = findObjectsService; this.ObjectTypeService = objectTypeService; }
/// <summary> /// Initiate services using DI /// </summary> public AppHost(ICsvParserService csvParserService, ICalculationService calculationService) { _csvParserService = csvParserService; _calculationService = calculationService; }
public CsvParserServiceTest() { _fileStreamReader = new Mock <IFileStreamReader>(); _csvParserService = new CsvParserService(_fileStreamReader.Object); }
public ClaimRepository(ICsvParserService <Claim> csvParserService) { _csvParserService = csvParserService; }
public UploadVehiclesController(ICsvParserService parser, ICarDataService carDataService) { _parser = parser; _carDataSvc = carDataService; }
public UploadController(IHostingEnvironment _IHostingEnvironment, ICsvParserService _ICsvParserService) { this._IHostingEnvironment = _IHostingEnvironment; this._ICsvParserService = _ICsvParserService; }
public MemberRepository(ICsvParserService <Member> csvParserService) { _csvParserService = csvParserService; }