Exemple #1
0
 public CachedMeasurementRepository(
     SensateContext context,
     IGeoQueryService geo,
     ILogger <MeasurementRepository> logger,
     ICacheStrategy <string> cache) : base(context, geo, logger)
 {
     this._cache = cache;
 }
Exemple #2
0
        public GeocodioQueryServiceTests()
        {
            var mockParser = new Mock <IGeoQueryParser>();

            mockParser.Setup(p => p.Parse(It.IsAny <string>())).Returns(new Dictionary <string, string>()
            {
                { "postal_code", "12345" }
            });

            var mockQueryDispatchSvc = new Mock <IGeoQueryDispatchService>();

            mockQueryDispatchSvc.Setup(q => q.Query(It.IsAny <string>())).ReturnsAsync(new GeoResponse());

            var mockMemcachedClient = new Mock <IMemcachedClient>();
            var mockOpResult        = new Mock <IGetOperationResult <GeoResponse> >();

            mockMemcachedClient.Setup(m => m.GetAsync <GeoResponse>(It.IsAny <string>())).Returns(Task.FromResult(mockOpResult.Object));

            _geocodioQueryService = new GeocodioQueryService(mockParser.Object, mockQueryDispatchSvc.Object, mockMemcachedClient.Object);
        }
Exemple #3
0
 public WeatherController(IGeoQueryService geoQueryService, IWeatherQueryService weatherQueryService)
 {
     this._geoQueryService     = geoQueryService;
     this._weatherQueryService = weatherQueryService;
 }
 public MeasurementRepository(SensateContext context, IGeoQueryService geo,
                              ILogger <MeasurementRepository> logger) : base(context.Measurements)
 {
     this._logger      = logger;
     this.m_geoService = geo;
 }
Exemple #5
0
 public MessageRepository(SensateContext ctx, IGeoQueryService geo) : base(ctx.Messages)
 {
     this._geoService = geo;
 }