Esempio n. 1
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>()));
 }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
        public void TestInitialize()
        {
            _elasticSearchGateway = Substitute.For <IElasticSearchGateway>();
            var geoJsonPreProcessor = Substitute.For <IOsmGeoJsonPreprocessorExecutor>();

            _httpGatewayFactory = Substitute.For <IHttpGatewayFactory>();
            var options = new ConfigurationData
            {
                ClosestPointTolerance = 30,
                DistanceToExisitngLineMergeThreshold = 1
            };
            var optionsProvider = Substitute.For <IOptions <ConfigurationData> >();

            optionsProvider.Value.Returns(options);

            _service = new OsmLineAdderService(_elasticSearchGateway, ItmWgs84MathTransfromFactory.Create(), optionsProvider, geoJsonPreProcessor, _httpGatewayFactory);
        }
Esempio n. 4
0
 /// <summary>
 /// Controller's constructor
 /// </summary>
 /// <param name="httpGatewayFactory"></param>
 /// <param name="dataContainerConverterService"></param>
 /// <param name="itmWgs84MathTransform"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="addibleGpxLinesFinderService"></param>
 /// <param name="osmLineAdderService"></param>
 /// <param name="options"></param>
 /// <param name="geometryFactory"></param>
 /// <param name="cache"></param>
 public OsmController(IHttpGatewayFactory httpGatewayFactory,
                      IDataContainerConverterService dataContainerConverterService,
                      IMathTransform itmWgs84MathTransform,
                      IElasticSearchGateway elasticSearchGateway,
                      IAddibleGpxLinesFinderService addibleGpxLinesFinderService,
                      IOsmLineAdderService osmLineAdderService,
                      IOptions <ConfigurationData> options,
                      IGeometryFactory geometryFactory,
                      LruCache <string, TokenAndSecret> cache)
 {
     _httpGatewayFactory            = httpGatewayFactory;
     _dataContainerConverterService = dataContainerConverterService;
     _itmWgs84MathTransform         = itmWgs84MathTransform;
     _elasticSearchGateway          = elasticSearchGateway;
     _addibleGpxLinesFinderService  = addibleGpxLinesFinderService;
     _osmLineAdderService           = osmLineAdderService;
     _options         = options.Value;
     _geometryFactory = geometryFactory;
     _cache           = cache;
 }
Esempio n. 5
0
 /// <summary>
 /// Controller's constructor
 /// </summary>
 /// <param name="clentsFactory"></param>
 /// <param name="dataContainerConverterService"></param>
 /// <param name="itmWgs84MathTransfromFactory"></param>
 /// <param name="elasticSearchGateway"></param>
 /// <param name="addibleGpxLinesFinderService"></param>
 /// <param name="osmLineAdderService"></param>
 /// <param name="options"></param>
 /// <param name="geometryFactory"></param>
 /// <param name="cache"></param>
 public OsmController(IClientsFactory clentsFactory,
                      IDataContainerConverterService dataContainerConverterService,
                      IItmWgs84MathTransfromFactory itmWgs84MathTransfromFactory,
                      IElasticSearchGateway elasticSearchGateway,
                      IAddibleGpxLinesFinderService addibleGpxLinesFinderService,
                      IOsmLineAdderService osmLineAdderService,
                      IOptions <ConfigurationData> options,
                      GeometryFactory geometryFactory,
                      LruCache <string, TokenAndSecret> cache)
 {
     _clentsFactory = clentsFactory;
     _dataContainerConverterService = dataContainerConverterService;
     _itmWgs84MathTransform         = itmWgs84MathTransfromFactory.Create();
     _wgs84ItmMathTransform         = itmWgs84MathTransfromFactory.CreateInverse();
     _elasticSearchGateway          = elasticSearchGateway;
     _addibleGpxLinesFinderService  = addibleGpxLinesFinderService;
     _osmLineAdderService           = osmLineAdderService;
     _options         = options.Value;
     _geometryFactory = geometryFactory;
     _cache           = cache;
 }