Ejemplo n.º 1
0
 public CsvParserLogic(
     ICsvParserService csvParserService,
     ILogger <CsvParserLogic> logger)
 {
     CsvParserService = csvParserService;
     Logger           = logger;
 }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
 public ServiceRunner(
     ICsvParserService parserService,
     IEsvBibleContext esvBibleContext)
 {
     _parserService   = parserService;
     _esvBibleContext = esvBibleContext;
 }
Ejemplo n.º 4
0
 public FileController(IXmlParserService xmlParserService, ICsvParserService csvParserService,
                       ITransactionService transactionService, IMapper mapper)
 {
     _xmlParserService   = xmlParserService;
     _csvParserService   = csvParserService;
     _transactionService = transactionService;
     _mapper             = mapper;
 }
Ejemplo n.º 5
0
 public FileProcessHandler(ICsvParserService csvParserService,
                           INormalizationService normalizationService,
                           IDataStorageRepository dataStorageRepository,
                           ILogger <FileProcessHandler> logger)
 {
     _csvParserService      = csvParserService;
     _normalizationService  = normalizationService;
     _dataStorageRepository = dataStorageRepository;
     _logger = logger;
 }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
0
        public ImportExportViewModel(ICsvParserService parserService)
        {
            _parserService = parserService;

            ExportCommand = new Command(() =>
            {
                ImportExportText = parserService.StringifyMemories(_existingMemories);
            });

            ImportCommand = new Command(async() =>
            {
                await ImportAsync();
            });
        }
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initiate services using DI
 /// </summary>
 public AppHost(ICsvParserService csvParserService, ICalculationService calculationService)
 {
     _csvParserService   = csvParserService;
     _calculationService = calculationService;
 }
Ejemplo n.º 10
0
 public CsvParserServiceTest()
 {
     _fileStreamReader = new Mock <IFileStreamReader>();
     _csvParserService = new CsvParserService(_fileStreamReader.Object);
 }
Ejemplo n.º 11
0
 public ClaimRepository(ICsvParserService <Claim> csvParserService)
 {
     _csvParserService = csvParserService;
 }
 public UploadVehiclesController(ICsvParserService parser, ICarDataService carDataService)
 {
     _parser     = parser;
     _carDataSvc = carDataService;
 }
Ejemplo n.º 13
0
 public UploadController(IHostingEnvironment _IHostingEnvironment, ICsvParserService _ICsvParserService)
 {
     this._IHostingEnvironment = _IHostingEnvironment;
     this._ICsvParserService   = _ICsvParserService;
 }
Ejemplo n.º 14
0
 public MemberRepository(ICsvParserService <Member> csvParserService)
 {
     _csvParserService = csvParserService;
 }