Ejemplo n.º 1
0
        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>());
        }
 /// <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="elevationDataStorage"></param>
 /// <param name="itmWgs84MathTransfromFactory"></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,
                                IElevationDataStorage elevationDataStorage,
                                IItmWgs84MathTransfromFactory itmWgs84MathTransfromFactory,
                                ILogger logger)
 {
     _elasticSearchGateway           = elasticSearchGateway;
     _osmGeoJsonPreprocessorExecutor = osmGeoJsonPreprocessorExecutor;
     _tagsHelper    = tagsHelper;
     _osmRepository = osmRepository;
     _pointsOfInterestAdapterFactory       = pointsOfInterestAdapterFactory;
     _pointsOfInterestFilesCreatorExecutor = pointsOfInterestFilesCreatorExecutor;
     _featuresMergeExecutor     = featuresMergeExecutor;
     _latestFileFetcherExecutor = latestFileFetcherExecutor;
     _graphHopperGateway        = graphHopperGateway;
     _osmGateway           = clinetsFactory.CreateNonAuthClient();
     _elevationDataStorage = elevationDataStorage;
     _logger        = logger;
     _mathTransform = itmWgs84MathTransfromFactory.CreateInverse();
 }
Ejemplo n.º 3
0
 /// <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;
 }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
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;
 }
Ejemplo n.º 6
0
 /// <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="pointsOfInterestAdapterFactory"></param>
 /// <param name="featuresMergeExecutor"></param>
 /// <param name="latestFileFetcherExecutor"></param>
 /// <param name="graphHopperGateway"></param>
 /// <param name="logger"></param>
 public ElasticSearchUpdaterService(IHttpGatewayFactory factory,
                                    IElasticSearchGateway elasticSearchGateway,
                                    IOsmGeoJsonPreprocessorExecutor osmGeoJsonPreprocessorExecutor,
                                    ITagsHelper tagsHelper, IOsmRepository osmRepository,
                                    IPointsOfInterestAdapterFactory pointsOfInterestAdapterFactory,
                                    IFeaturesMergeExecutor featuresMergeExecutor,
                                    IOsmLatestFileFetcherExecutor latestFileFetcherExecutor,
                                    IGraphHopperGateway graphHopperGateway,
                                    ILogger logger)
 {
     _elasticSearchGateway           = elasticSearchGateway;
     _osmGeoJsonPreprocessorExecutor = osmGeoJsonPreprocessorExecutor;
     _tagsHelper    = tagsHelper;
     _osmRepository = osmRepository;
     _pointsOfInterestAdapterFactory = pointsOfInterestAdapterFactory;
     _logger = logger;
     _featuresMergeExecutor     = featuresMergeExecutor;
     _latestFileFetcherExecutor = latestFileFetcherExecutor;
     _graphHopperGateway        = graphHopperGateway;
     _osmGateway = factory.CreateOsmGateway(new TokenAndSecret("", ""));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="pointsOfInterestAdapterFactory"></param>
 public PointsOfInterestAggregatorService(IPointsOfInterestAdapterFactory pointsOfInterestAdapterFactory)
 {
     _pointsOfInterestAdapterFactory = pointsOfInterestAdapterFactory;
 }