public void TestInitialize()
        {
            _clientsFactory = Substitute.For <IClientsFactory>();
            _osmGateway     = Substitute.For <INonAuthClient>();
            _clientsFactory.CreateNonAuthClient().Returns(_osmGateway);
            var options         = new ConfigurationData();
            var optionsProvider = Substitute.For <IOptions <ConfigurationData> >();

            optionsProvider.Value.Returns(options);
            _elasticSearchGateway                 = Substitute.For <IElasticSearchGateway>();
            _osmRepository                        = Substitute.For <IOsmRepository>();
            _geoJsonPreprocessorExecutor          = Substitute.For <IOsmGeoJsonPreprocessorExecutor>();
            _featuresMergeExecutor                = Substitute.For <IFeaturesMergeExecutor>();
            _graphHopperGateway                   = Substitute.For <IGraphHopperGateway>();
            _osmLatestFileFetcherExecutor         = Substitute.For <IOsmLatestFileFetcherExecutor>();
            _pointsOfInterestFilesCreatorExecutor = Substitute.For <IPointsOfInterestFilesCreatorExecutor>();
            _pointsOfInterestAdapterFactory       = Substitute.For <IPointsOfInterestAdapterFactory>();
            _service = new DatabasesUpdaterService(_clientsFactory,
                                                   _elasticSearchGateway,
                                                   _geoJsonPreprocessorExecutor,
                                                   new TagsHelper(optionsProvider),
                                                   _osmRepository,
                                                   _pointsOfInterestAdapterFactory,
                                                   _featuresMergeExecutor,
                                                   _osmLatestFileFetcherExecutor,
                                                   _graphHopperGateway,
                                                   _pointsOfInterestFilesCreatorExecutor,
                                                   null,
                                                   Substitute.For <ILogger>());
        }
 public void TestInitialize()
 {
     _elasticSearchGateway = Substitute.For <IElasticSearchGateway>();
     _controller           = new SearchController(_elasticSearchGateway, new List <ICoordinatesParser> {
         new DecimalLatLonParser()
     });
 }
 /// <summary>
 /// Service's constructor
 /// </summary>
 /// <param name="clinetsFactory"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="osmGeoJsonPreprocessorExecutor"></param>
 /// <param name="tagsHelper"></param>
 /// <param name="osmRepository"></param>
 /// <param name="pointsOfInterestAdapterFactory"></param>
 /// <param name="featuresMergeExecutor"></param>
 /// <param name="latestFileFetcherExecutor"></param>
 /// <param name="graphHopperGateway"></param>
 /// <param name="pointsOfInterestFilesCreatorExecutor"></param>
 /// <param name="imagesUrlsStorageExecutor"></param>
 /// <param name="logger"></param>
 public DatabasesUpdaterService(IClientsFactory clinetsFactory,
                                IElasticSearchGateway elasticSearchGateway,
                                IOsmGeoJsonPreprocessorExecutor osmGeoJsonPreprocessorExecutor,
                                ITagsHelper tagsHelper, IOsmRepository osmRepository,
                                IPointsOfInterestAdapterFactory pointsOfInterestAdapterFactory,
                                IFeaturesMergeExecutor featuresMergeExecutor,
                                IOsmLatestFileFetcherExecutor latestFileFetcherExecutor,
                                IGraphHopperGateway graphHopperGateway,
                                IPointsOfInterestFilesCreatorExecutor pointsOfInterestFilesCreatorExecutor,
                                IImagesUrlsStorageExecutor imagesUrlsStorageExecutor,
                                ILogger logger)
 {
     _elasticSearchGateway           = elasticSearchGateway;
     _osmGeoJsonPreprocessorExecutor = osmGeoJsonPreprocessorExecutor;
     _tagsHelper    = tagsHelper;
     _osmRepository = osmRepository;
     _pointsOfInterestAdapterFactory       = pointsOfInterestAdapterFactory;
     _pointsOfInterestFilesCreatorExecutor = pointsOfInterestFilesCreatorExecutor;
     _featuresMergeExecutor     = featuresMergeExecutor;
     _latestFileFetcherExecutor = latestFileFetcherExecutor;
     _graphHopperGateway        = graphHopperGateway;
     _osmGateway = clinetsFactory.CreateNonAuthClient();
     _imagesUrlsStorageExecutor = imagesUrlsStorageExecutor;
     _logger = logger;
 }
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="elevationDataStorage"></param>
 /// <param name="clentsFactory"></param>
 /// <param name="osmGeoJsonPreprocessorExecutor"></param>
 /// <param name="osmRepository"></param>
 /// <param name="dataContainerConverterService"></param>
 /// <param name="wikipediaGateway"></param>
 /// <param name="itmWgs84MathTransfromFactory"></param>
 /// <param name="latestFileFetcherExecutor"></param>
 /// <param name="tagsHelper"></param>
 /// <param name="options"></param>
 /// <param name="logger"></param>
 public OsmPointsOfInterestAdapter(IElasticSearchGateway elasticSearchGateway,
                                   IElevationDataStorage elevationDataStorage,
                                   IClientsFactory clentsFactory,
                                   IOsmGeoJsonPreprocessorExecutor osmGeoJsonPreprocessorExecutor,
                                   IOsmRepository osmRepository,
                                   IDataContainerConverterService dataContainerConverterService,
                                   IWikipediaGateway wikipediaGateway,
                                   IItmWgs84MathTransfromFactory itmWgs84MathTransfromFactory,
                                   IOsmLatestFileFetcherExecutor latestFileFetcherExecutor,
                                   ITagsHelper tagsHelper,
                                   IOptions <ConfigurationData> options,
                                   ILogger logger) :
     base(dataContainerConverterService,
          logger)
 {
     _clientsFactory = clentsFactory;
     _osmGeoJsonPreprocessorExecutor = osmGeoJsonPreprocessorExecutor;
     _osmRepository             = osmRepository;
     _wikipediaGateway          = wikipediaGateway;
     _tagsHelper                = tagsHelper;
     _latestFileFetcherExecutor = latestFileFetcherExecutor;
     _elevationDataStorage      = elevationDataStorage;
     _wgs84ItmMathTransform     = itmWgs84MathTransfromFactory.CreateInverse();
     _options = options.Value;
     _elasticSearchGateway = elasticSearchGateway;
 }
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="elevationDataStorage"></param>
 /// <param name="httpGatewayFactory"></param>
 /// <param name="osmGeoJsonPreprocessorExecutor"></param>
 /// <param name="osmRepository"></param>
 /// <param name="dataContainerConverterService"></param>
 /// <param name="wikipediaGateway"></param>
 /// <param name="itmWgs84MathTransfromFactory"></param>
 /// <param name="latestFileFetcherExecutor"></param>
 /// <param name="tagsHelper"></param>
 /// <param name="options"></param>
 /// <param name="logger"></param>
 public OsmPointsOfInterestAdapter(IElasticSearchGateway elasticSearchGateway,
                                   IElevationDataStorage elevationDataStorage,
                                   IHttpGatewayFactory httpGatewayFactory,
                                   IOsmGeoJsonPreprocessorExecutor osmGeoJsonPreprocessorExecutor,
                                   IOsmRepository osmRepository,
                                   IDataContainerConverterService dataContainerConverterService,
                                   IWikipediaGateway wikipediaGateway,
                                   IItmWgs84MathTransfromFactory itmWgs84MathTransfromFactory,
                                   IOsmLatestFileFetcherExecutor latestFileFetcherExecutor,
                                   ITagsHelper tagsHelper,
                                   IOptions <ConfigurationData> options,
                                   ILogger logger) :
     base(elevationDataStorage,
          elasticSearchGateway,
          dataContainerConverterService,
          itmWgs84MathTransfromFactory,
          options,
          logger)
 {
     _httpGatewayFactory             = httpGatewayFactory;
     _osmGeoJsonPreprocessorExecutor = osmGeoJsonPreprocessorExecutor;
     _osmRepository             = osmRepository;
     _wikipediaGateway          = wikipediaGateway;
     _tagsHelper                = tagsHelper;
     _latestFileFetcherExecutor = latestFileFetcherExecutor;
 }
Exemple #6
0
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="adaptersFactory"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="logger"></param>
 public ExternalSourcesController(IPointsOfInterestAdapterFactory adaptersFactory,
                                  IElasticSearchGateway elasticSearchGateway,
                                  ILogger logger)
 {
     _adaptersFactory      = adaptersFactory;
     _elasticSearchGateway = elasticSearchGateway;
     _logger = logger;
 }
        public void TestInitialize()
        {
            _elasticSearchGateway = Substitute.For <IElasticSearchGateway>();
            var elevationDataStorage = Substitute.For <IElevationDataStorage>();

            _dataContainerConverterService = Substitute.For <IDataContainerConverterService>();
            _controller = new SearchController(_elasticSearchGateway, _dataContainerConverterService, elevationDataStorage, ItmWgs84MathTransfromFactory.Create());
        }
 public void TestInitialize()
 {
     _elasticSearchGateway = Substitute.For<IElasticSearchGateway>();
     var elevationDataStorage = Substitute.For<IElevationDataStorage>();
     
     _dataContainerConverterService = Substitute.For<IDataContainerConverterService>();
     _controller = new SearchController(_elasticSearchGateway, _dataContainerConverterService, elevationDataStorage);
 }
 /// <summary>
 /// Adapter's constructor
 /// </summary>
 /// <param name="elevationDataStorage"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="dataContainerConverterService"></param>
 protected BasePointsOfInterestAdapter(IElevationDataStorage elevationDataStorage,
                                       IElasticSearchGateway elasticSearchGateway,
                                       IDataContainerConverterService dataContainerConverterService)
 {
     _elevationDataStorage          = elevationDataStorage;
     _elasticSearchGateway          = elasticSearchGateway;
     _dataContainerConverterService = dataContainerConverterService;
 }
Exemple #10
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="nakebGateway"></param>
 /// <param name="elevationDataStorage"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="logger"></param>
 public NakebPointsOfInterestAdapter(INakebGateway nakebGateway,
                                     IElevationDataStorage elevationDataStorage,
                                     IElasticSearchGateway elasticSearchGateway,
                                     ILogger logger) : base(elevationDataStorage, elasticSearchGateway)
 {
     _nakebGateway = nakebGateway;
     _logger       = logger;
 }
 public SearchController(IElasticSearchGateway elasticSearchGateway, 
     IDataContainerConverterService dataContainerConverterService, 
     IElevationDataStorage elevationDataStorage)
 {
     _elasticSearchGateway = elasticSearchGateway;
     _dataContainerConverterService = dataContainerConverterService;
     _elevationDataStorage = elevationDataStorage;
 }
Exemple #12
0
 protected void InitializeSubstitues()
 {
     _itmWgs84MathTransfromFactory  = new ItmWgs84MathTransfromFactory();
     _dataContainerConverterService = Substitute.For <IDataContainerConverterService>();
     _elasticSearchGateway          = Substitute.For <IElasticSearchGateway>();
     _elevationDataStorage          = Substitute.For <IElevationDataStorage>();
     _options = Substitute.For <IOptions <ConfigurationData> >();
     _options.Value.Returns(new ConfigurationData());
 }
Exemple #13
0
 /// <inheritdoc />
 public OffRoadPointsOfInterestAdapter(IElevationDataStorage elevationDataStorage,
                                       IElasticSearchGateway elasticSearchGateway,
                                       IOffRoadGateway offRoadGateway,
                                       ILogger logger) :
     base(elevationDataStorage, elasticSearchGateway)
 {
     _offRoadGateway = offRoadGateway;
     _logger         = logger;
 }
Exemple #14
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="nakebGateway"></param>
 /// <param name="elevationDataStorage"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="dataContainerConverterService"></param>
 /// <param name="logger"></param>
 public NakebPointsOfInterestAdapter(INakebGateway nakebGateway,
                                     IElevationDataStorage elevationDataStorage,
                                     IElasticSearchGateway elasticSearchGateway,
                                     IDataContainerConverterService dataContainerConverterService,
                                     ILogger logger) : base(elevationDataStorage, elasticSearchGateway, dataContainerConverterService)
 {
     _nakebGateway = nakebGateway;
     _logger       = logger;
 }
Exemple #15
0
 /// <inheritdoc />
 public OffRoadPointsOfInterestAdapter(IElevationDataStorage elevationDataStorage,
                                       IElasticSearchGateway elasticSearchGateway,
                                       IOffRoadGateway offRoadGateway,
                                       IDataContainerConverterService dataContainerConverterService,
                                       ILogger logger) :
     base(elevationDataStorage, elasticSearchGateway, dataContainerConverterService)
 {
     _offRoadGateway = offRoadGateway;
     _logger         = logger;
 }
Exemple #16
0
        public void TestInitialize()
        {
            _graphHopperGateway          = Substitute.For <IGraphHopperGateway>();
            _elasticSearchGateway        = Substitute.For <IElasticSearchGateway>();
            _osmRepository               = Substitute.For <IOsmRepository>();
            _geoJsonPreprocessorExecutor = Substitute.For <IOsmGeoJsonPreprocessorExecutor>();
            var logger = Substitute.For <ILogger>();

            _updateController = new UpdateController(_graphHopperGateway, _elasticSearchGateway, _geoJsonPreprocessorExecutor, _osmRepository, new List <IPointsOfInterestAdapter>(), logger);
        }
        public void TestInitialize()
        {
            _elasticSearchGateway = Substitute.For <IElasticSearchGateway>();
            _options = new ConfigurationData();
            var optionsProvider = Substitute.For <IOptions <ConfigurationData> >();

            optionsProvider.Value.Returns(_options);
            var geometryFactory = GeometryFactory.Default;

            _service = new AddibleGpxLinesFinderService(new GpxLoopsSplitterExecutor(geometryFactory), new GpxProlongerExecutor(geometryFactory), new ItmWgs84MathTransfromFactory(), _elasticSearchGateway, optionsProvider, geometryFactory, Substitute.For <ILogger>());
        }
Exemple #18
0
 public void TestInitialize()
 {
     _elasticSearchGateway           = Substitute.For <IElasticSearchGateway>();
     _elevationDataStorage           = Substitute.For <IElevationDataStorage>();
     _httpGatewayFactory             = Substitute.For <IHttpGatewayFactory>();
     _tagsHelper                     = new TagsHelper(new OptionsWrapper <ConfigurationData>(new ConfigurationData()));
     _osmGeoJsonPreprocessorExecutor = new OsmGeoJsonPreprocessorExecutor(Substitute.For <ILogger>(), new OsmGeoJsonConverter(), _tagsHelper);
     _osmRepository                  = Substitute.For <IOsmRepository>();
     _dataContainerConverterService  = Substitute.For <IDataContainerConverterService>();
     _adapter = new OsmPointsOfInterestAdapter(_elasticSearchGateway, _elevationDataStorage, _httpGatewayFactory, _osmGeoJsonPreprocessorExecutor, _osmRepository, _dataContainerConverterService, _tagsHelper);
 }
Exemple #19
0
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="adaptersFactory"></param>
 /// <param name="elevationDataStorage"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="itmWgs84MathTransfromFactory"></param>
 /// <param name="logger"></param>
 public ExternalSourcesController(IPointsOfInterestAdapterFactory adaptersFactory,
                                  IElevationDataStorage elevationDataStorage,
                                  IElasticSearchGateway elasticSearchGateway,
                                  IItmWgs84MathTransfromFactory itmWgs84MathTransfromFactory,
                                  ILogger logger)
 {
     _adaptersFactory      = adaptersFactory;
     _elevationDataStorage = elevationDataStorage;
     _elasticSearchGateway = elasticSearchGateway;
     _wgs84ItmTransform    = itmWgs84MathTransfromFactory.CreateInverse();
     _logger = logger;
 }
Exemple #20
0
 /// <summary>
 /// Controller's constructor
 /// </summary>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="itmWgs84MathTransfromFactory"></param>
 public SearchController(IElasticSearchGateway elasticSearchGateway,
                         IItmWgs84MathTransfromFactory itmWgs84MathTransfromFactory)
 {
     _elasticSearchGateway = elasticSearchGateway;
     _coordinatesParsers   = new List <ICoordinatesParser>
     {
         new ReverseDegreesMinutesSecondsLatLonParser(),
         new DegreesMinutesSecondsLatLonParser(),
         new DecimalLatLonParser(),
         new UtmParser(itmWgs84MathTransfromFactory.Create())
     };
 }
Exemple #21
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="itmWgs84MathTransform"></param>
 /// <param name="options"></param>
 /// <param name="geoJsonPreprocessorExecutor"></param>
 /// <param name="httpGatewayFactory"></param>
 public OsmLineAdderService(IElasticSearchGateway elasticSearchGateway,
                            IMathTransform itmWgs84MathTransform,
                            IOptions <ConfigurationData> options,
                            IOsmGeoJsonPreprocessorExecutor geoJsonPreprocessorExecutor,
                            IHttpGatewayFactory httpGatewayFactory)
 {
     _elasticSearchGateway  = elasticSearchGateway;
     _itmWgs84MathTransform = itmWgs84MathTransform;
     _options = options.Value;
     _geoJsonPreprocessorExecutor = geoJsonPreprocessorExecutor;
     _httpGatewayFactory          = httpGatewayFactory;
 }
Exemple #22
0
 /// <inheritdoc />
 public OsmPointsOfInterestAdapter(IElasticSearchGateway elasticSearchGateway,
                                   IElevationDataStorage elevationDataStorage,
                                   IHttpGatewayFactory httpGatewayFactory,
                                   IOsmGeoJsonPreprocessorExecutor osmGeoJsonPreprocessorExecutor,
                                   IOsmRepository osmRepository,
                                   ITagsHelper tagsHelper) : base(elevationDataStorage, elasticSearchGateway)
 {
     _elasticSearchGateway           = elasticSearchGateway;
     _httpGatewayFactory             = httpGatewayFactory;
     _osmGeoJsonPreprocessorExecutor = osmGeoJsonPreprocessorExecutor;
     _osmRepository = osmRepository;
     _tagsHelper    = tagsHelper;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="itmWgs84MathTransfromFactory"></param>
 /// <param name="options"></param>
 /// <param name="geoJsonPreprocessorExecutor"></param>
 /// <param name="factory"></param>
 public OsmLineAdderService(IElasticSearchGateway elasticSearchGateway,
                            IItmWgs84MathTransfromFactory itmWgs84MathTransfromFactory,
                            IOptions <ConfigurationData> options,
                            IOsmGeoJsonPreprocessorExecutor geoJsonPreprocessorExecutor,
                            IClientsFactory factory)
 {
     _elasticSearchGateway  = elasticSearchGateway;
     _itmWgs84MathTransform = itmWgs84MathTransfromFactory.Create();
     _wgs84ItmMathTransform = itmWgs84MathTransfromFactory.CreateInverse();
     _options = options.Value;
     _geoJsonPreprocessorExecutor = geoJsonPreprocessorExecutor;
     _factory = factory;
 }
Exemple #24
0
 /// <summary>
 /// Controller's constructor
 /// </summary>
 /// <param name="graphHopperGateway"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="osmGeoJsonPreprocessorExecutor"></param>
 /// <param name="osmRepository"></param>
 /// <param name="adapters"></param>
 /// <param name="logger"></param>
 public UpdateController(IGraphHopperGateway graphHopperGateway,
                         IElasticSearchGateway elasticSearchGateway,
                         IOsmGeoJsonPreprocessorExecutor osmGeoJsonPreprocessorExecutor,
                         IOsmRepository osmRepository,
                         IEnumerable <IPointsOfInterestAdapter> adapters,
                         ILogger logger)
 {
     _graphHopperGateway             = graphHopperGateway;
     _elasticSearchGateway           = elasticSearchGateway;
     _osmGeoJsonPreprocessorExecutor = osmGeoJsonPreprocessorExecutor;
     _osmRepository = osmRepository;
     _adapters      = adapters;
     _logger        = logger;
 }
Exemple #25
0
 /// <summary>
 /// Adapter's constructor
 /// </summary>
 /// <param name="elevationDataStorage"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="dataContainerConverterService"></param>
 /// <param name="itmWgs84MathTransfromFactory"></param>
 /// <param name="options"></param>
 /// <param name="logger"></param>
 protected BasePointsOfInterestAdapter(IElevationDataStorage elevationDataStorage,
                                       IElasticSearchGateway elasticSearchGateway,
                                       IDataContainerConverterService dataContainerConverterService,
                                       IItmWgs84MathTransfromFactory itmWgs84MathTransfromFactory,
                                       IOptions <ConfigurationData> options,
                                       ILogger logger)
 {
     _elevationDataStorage          = elevationDataStorage;
     _elasticSearchGateway          = elasticSearchGateway;
     _dataContainerConverterService = dataContainerConverterService;
     _wgs84ItmMathTransform         = itmWgs84MathTransfromFactory.CreateInverse();
     _options = options.Value;
     _logger  = logger;
 }
 /// <inheritdoc />
 public WikipediaPointsOfInterestAdapter(IElevationDataStorage elevationDataStorage,
                                         IElasticSearchGateway elasticSearchGateway,
                                         IDataContainerConverterService dataContainerConverterService,
                                         IWikipediaGateway wikipediaGateway,
                                         IHttpGatewayFactory httpGatewayFactory,
                                         IItmWgs84MathTransfromFactory itmWgs84MathTransfromFactory,
                                         ILogger logger) :
     base(elevationDataStorage, elasticSearchGateway, dataContainerConverterService)
 {
     _wikipediaGateway             = wikipediaGateway;
     _logger                       = logger;
     _itmWgs84MathTransfromFactory = itmWgs84MathTransfromFactory;
     _remoteFileFetcherGateway     = httpGatewayFactory.CreateRemoteFileFetcherGateway(null);
 }
Exemple #27
0
 public OsmController(IHttpGatewayFactory httpGatewayFactory,
     IDataContainerConverterService dataContainerConverterService,
     ICoordinatesConverter coordinatesConverter,
     IGpxSplitterService gpxSplitterService,
     IElasticSearchGateway elasticSearchGateway,
     LruCache<string, TokenAndSecret> cache)
 {
     _httpGatewayFactory = httpGatewayFactory;
     _dataContainerConverterService = dataContainerConverterService;
     _coordinatesConverter = coordinatesConverter;
     _gpxSplitterService = gpxSplitterService;
     _cache = cache;
     _elasticSearchGateway = elasticSearchGateway;
 }
Exemple #28
0
 public void TestInitialize()
 {
     _httpGatewayFactory = Substitute.For<IHttpGatewayFactory>();
     _dataContainerConverterService = Substitute.For<IDataContainerConverterService>();
     _elasticSearchGateway = Substitute.For<IElasticSearchGateway>();
     _addibleGpxLinesFinderService = Substitute.For<IAddibleGpxLinesFinderService>();
     _osmLineAdderService = Substitute.For<IOsmLineAdderService>();
     _options = new ConfigurationData();
     var optionsProvider = Substitute.For<IOptions<ConfigurationData>>();
     optionsProvider.Value.Returns(_options);
     _controller = new OsmController(_httpGatewayFactory, _dataContainerConverterService, ItmWgs84MathTransfromFactory.Create(), 
         _elasticSearchGateway, _addibleGpxLinesFinderService, _osmLineAdderService, optionsProvider, GeometryFactory.Default,
         new LruCache<string, TokenAndSecret>(optionsProvider, Substitute.For<ILogger>()));
 }
 public void TestInitialize()
 {
     _graphHopperHelper = Substitute.For<IGraphHopperHelper>();
     _remoteFileFetcherGateway = Substitute.For<IRemoteFileFetcherGateway>();
     var factory = Substitute.For<IHttpGatewayFactory>();
     factory.CreateRemoteFileFetcherGateway(Arg.Any<TokenAndSecret>()).Returns(_remoteFileFetcherGateway);
     _remoteFileSizeFetcherGateway = Substitute.For<IRemoteFileSizeFetcherGateway>();
     _fileSystemHelper = Substitute.For<IFileSystemHelper>();
     _elasticSearchGateway = Substitute.For<IElasticSearchGateway>();
     _elasticSearchHelper = Substitute.For<INssmHelper>();
     _osmRepository = Substitute.For<IOsmRepository>();
     _osmGeoJsonPreprocessor = Substitute.For<IOsmGeoJsonPreprocessor>();
     _osmDataService = new OsmDataService(_graphHopperHelper, factory, _remoteFileSizeFetcherGateway, _fileSystemHelper,
         _elasticSearchGateway, _elasticSearchHelper, _osmRepository, _osmGeoJsonPreprocessor, Substitute.For<ILogger>());
 }
 /// <summary>
 /// Service's constructor
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="osmGeoJsonPreprocessorExecutor"></param>
 /// <param name="tagsHelper"></param>
 /// <param name="osmRepository"></param>
 /// <param name="adapters"></param>
 /// <param name="logger"></param>
 public OsmElasticSearchUpdaterService(IHttpGatewayFactory factory,
                                       IElasticSearchGateway elasticSearchGateway,
                                       IOsmGeoJsonPreprocessorExecutor osmGeoJsonPreprocessorExecutor,
                                       ITagsHelper tagsHelper, IOsmRepository osmRepository,
                                       IEnumerable <IPointsOfInterestAdapter> adapters,
                                       ILogger logger)
 {
     _elasticSearchGateway           = elasticSearchGateway;
     _osmGeoJsonPreprocessorExecutor = osmGeoJsonPreprocessorExecutor;
     _tagsHelper    = tagsHelper;
     _osmRepository = osmRepository;
     _adapters      = adapters;
     _logger        = logger;
     _osmGateway    = factory.CreateOsmGateway(new TokenAndSecret("", ""));
 }
        public void TestInitialize()
        {
            _httpGatewayFactory = Substitute.For <IHttpGatewayFactory>();
            var options         = new ConfigurationData();
            var optionsProvider = Substitute.For <IOptions <ConfigurationData> >();

            optionsProvider.Value.Returns(options);
            _elasticSearchGateway         = Substitute.For <IElasticSearchGateway>();
            _osmRepository                = Substitute.For <IOsmRepository>();
            _geoJsonPreprocessorExecutor  = Substitute.For <IOsmGeoJsonPreprocessorExecutor>();
            _featuresMergeExecutor        = Substitute.For <IFeaturesMergeExecutor>();
            _graphHopperGateway           = Substitute.For <IGraphHopperGateway>();
            _osmLatestFileFetcherExecutor = Substitute.For <IOsmLatestFileFetcherExecutor>();
            _service = new ElasticSearchUpdaterService(_httpGatewayFactory, _elasticSearchGateway, _geoJsonPreprocessorExecutor, new TagsHelper(optionsProvider), _osmRepository, Substitute.For <IPointsOfInterestAdapterFactory>(), _featuresMergeExecutor, _osmLatestFileFetcherExecutor, _graphHopperGateway, Substitute.For <ILogger>());
        }
Exemple #32
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="gpxLoopsSplitterExecutor"></param>
 /// <param name="gpxProlongerExecutor"></param>
 /// <param name="itmWgs84MathTransfrom"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="options"></param>
 /// <param name="geometryFactory"></param>
 /// <param name="logger"></param>
 public AddibleGpxLinesFinderService(IGpxLoopsSplitterExecutor gpxLoopsSplitterExecutor,
                                     IGpxProlongerExecutor gpxProlongerExecutor,
                                     IMathTransform itmWgs84MathTransfrom,
                                     IElasticSearchGateway elasticSearchGateway,
                                     IOptions <ConfigurationData> options,
                                     IGeometryFactory geometryFactory,
                                     ILogger logger)
 {
     _gpxLoopsSplitterExecutor = gpxLoopsSplitterExecutor;
     _gpxProlongerExecutor     = gpxProlongerExecutor;
     _itmWgs84MathTransfrom    = itmWgs84MathTransfrom;
     _elasticSearchGateway     = elasticSearchGateway;
     _geometryFactory          = geometryFactory;
     _logger  = logger;
     _options = options.Value;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="nakebGateway"></param>
 /// <param name="elevationDataStorage"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="dataContainerConverterService"></param>
 /// <param name="itmWgs84MathTransfromFactory"></param>
 /// <param name="options"></param>
 /// <param name="logger"></param>
 public NakebPointsOfInterestAdapter(INakebGateway nakebGateway,
                                     IElevationDataStorage elevationDataStorage,
                                     IElasticSearchGateway elasticSearchGateway,
                                     IDataContainerConverterService dataContainerConverterService,
                                     IItmWgs84MathTransfromFactory itmWgs84MathTransfromFactory,
                                     IOptions <ConfigurationData> options,
                                     ILogger logger) :
     base(elevationDataStorage,
          elasticSearchGateway,
          dataContainerConverterService,
          itmWgs84MathTransfromFactory,
          options,
          logger)
 {
     _nakebGateway = nakebGateway;
 }
        public void TestInitialize()
        {
            _elasticSearchGateway = Substitute.For <IElasticSearchGateway>();
            var geoJsonPreProcessor = Substitute.For <IOsmGeoJsonPreprocessorExecutor>();

            _clientsFactory = Substitute.For <IClientsFactory>();
            var options = new ConfigurationData
            {
                MinimalDistanceToClosestPoint     = 30,
                MaxDistanceToExisitngLineForMerge = 1
            };
            var optionsProvider = Substitute.For <IOptions <ConfigurationData> >();

            optionsProvider.Value.Returns(options);

            _service = new OsmLineAdderService(_elasticSearchGateway, new ItmWgs84MathTransfromFactory(), optionsProvider, geoJsonPreProcessor, _clientsFactory, new GeometryFactory());
        }
 public OsmDataService(IGraphHopperHelper graphHopperHelper,
     IHttpGatewayFactory httpGatewayFactory,
     IRemoteFileSizeFetcherGateway remoteFileSizeFetcherGateway,
     IFileSystemHelper fileSystemHelper,
     IElasticSearchGateway elasticSearchGateway,
     INssmHelper elasticSearchHelper,
     IOsmRepository osmRepository,
     IOsmGeoJsonPreprocessor osmGeoJsonPreprocessor,
     ILogger logger)
 {
     _graphHopperHelper = graphHopperHelper;
     _httpGatewayFactory = httpGatewayFactory;
     _remoteFileSizeFetcherGateway = remoteFileSizeFetcherGateway;
     _fileSystemHelper = fileSystemHelper;
     _elasticSearchGateway = elasticSearchGateway;
     _elasticSearchHelper = elasticSearchHelper;
     _osmRepository = osmRepository;
     _osmGeoJsonPreprocessor = osmGeoJsonPreprocessor;
     _logger = logger;
 }