Example #1
0
        public void Testa_GetAll_Valida_Tipo()
        {
            _weather = new WeatherService();

            List <WeatherForecast> result = new List <WeatherForecast>();

            result.AddRange(_weather.GetAll());

            Assert.IsType <WeatherForecast>(result[0]);
        }
Example #2
0
        public void Testa_GetAll_Valida_Quantidade()
        {
            _weather = new WeatherService();

            List <WeatherForecast> result = new List <WeatherForecast>();

            result.AddRange(_weather.GetAll());

            Assert.True(result.Count == Summaries.Length);
        }
Example #3
0
        public void Testa_GetAll_Valida_Retorno()
        {
            _weather = new WeatherService();
            WeatherForecast model = new WeatherForecast();

            List <WeatherForecast> result = new List <WeatherForecast>();

            result.AddRange(_weather.GetAll());

            model = result[0];

            Assert.Contains(model, result);
        }
 public async Task <ActionResult <OpenWeatherForecastModel> > GetByZipCode(string zipCode, [FromServices] IWeatherServices wsvc) => await wsvc.GetWeatherResults(zipCode, false);
 public async Task <ActionResult <OpenWeatherForecastModel> > GetByCityName(string cityName, [FromServices] IWeatherServices wsvc) => await wsvc.GetWeatherResults(cityName, true);
Example #6
0
 public WeatherForecastController(ILogger <WeatherForecastController> logger, IWeatherServices weatherServices)
 {
     _logger          = logger;
     _weatherServices = weatherServices;
 }
Example #7
0
 public WeatherTilesController(IWeatherServices weatherServices)
 {
     _weatherService = weatherServices ?? throw new ArgumentNullException(nameof(weatherServices));
 }
 public OpenWeatherController(IWeatherServices weatherServices, IHostingEnvironment hostingenv)
 {
     _weatherServices = weatherServices;
     _hostingenv      = hostingenv;
 }
Example #9
0
 public WeatherPluginHandler(ILogger <WeatherPluginHandler> logger, IWeatherServices weatherServices)
 {
     _logger          = logger;
     _weatherServices = weatherServices;
 }
Example #10
0
 public WeatherController()
 {
     _weatherServices = ServicesFactory.GetWeatherServices();
 }
Example #11
0
 public WeatherController(IWeatherServices weatherServices)
 {
     _weatherServices = weatherServices;
 }
 public WeatherForecastController(ILogger <WeatherForecastController> logger, IWeatherServices openWeatherServices, ISpotifyServices spotifyServices)
 {
     _logger = logger;
     _openWeatherServices = openWeatherServices;
     _spotifyServices     = spotifyServices;
 }