public WeatherPlaylistService(
            IPlaylistService playlistService,
            ICityWeatherService weatherForecastService,
            ICityRequestRepository cityRequestRepository,
            IMemoryCache memoryCache,
            INotificator notificator,
            ILogger <WeatherPlaylistService> logger)
        {
            _weatherForecastService = weatherForecastService;
            _playlistService        = playlistService;
            _cityRequestRepository  = cityRequestRepository;
            _memoryCache            = memoryCache;
            _notificator            = notificator;
            _logger = logger;

            _cacheExpiryOptions = SetMemoryCacheOptions();
        }
        public void Setup()
        {
            _mockWeatherRepository = new Mock <ICityWeatherRepository>();
            _weatherService        = new CityWeatherService(_mockWeatherRepository.Object);
            var dummyWeatherDetails = new WeatherDetails()
            {
                Name    = "Cairns",
                Weather = new Weather[]
                {
                    new Weather()
                    {
                        Id          = 802,
                        Main        = "Clouds",
                        Description = "scattered clouds",
                        Icon        = "03n"
                    }
                }
            };

            _mockWeatherRepository.Setup(x => x.GetWeatherForCityAsync(It.IsAny <Int32>(), It.IsAny <string>(), It.IsAny <string>())).Returns(Task.FromResult(dummyWeatherDetails));
        }
示例#3
0
 public CityWeatherController(ICityWeatherService weatherService)
 {
     _weatherService = weatherService;
 }
示例#4
0
 public RefreshWeatherJob(ICityService cityService, ICityWeatherService cityWeatherService, ILogger <RefreshWeatherJob> logger)
 {
     _cityService        = cityService;
     _cityWeatherService = cityWeatherService;
     _loger = logger;
 }
 public CityWeatherController(ILogger <CityWeatherController> logger, ICityWeatherService service)
 {
     _logger  = logger;
     _service = service;
 }
 public CityWeatherController(ICityWeatherService cityWeatherService, IOptions <WeatherSettings> weatherSettings)
 {
     _cityWeatherService = cityWeatherService;
     _weatherSettings    = weatherSettings;
 }