public OpenWeatherMapClientTest() { _mockHttpMessageHandler = new Mock <HttpMessageHandler>(); _mockConfig = new OpenWeatherMapConfig() { ApiBaseUrl = "fakebaseurl" }; }
public ForecastServiceTest() { _openWeatherMapConfig = new OpenWeatherMapConfig { IconUrl = "fakeurl/{0}.png" }; _mockMapper = new Mock <IMapper>(); _mockGetForecastFunc = new Mock <Func <string, string, string, Task <WeatherForecastResponse> > >(); _mockGetCurrentWeatherFunc = new Mock <Func <string, string, string, Task <CurrentWeatherResponse> > >(); _mapper = new MapperConfiguration(cfg => { cfg.AddProfile(new WeatherForecastMappingProfile()); }).CreateMapper(); _mockCurrentWeatherResponse = new CurrentWeatherResponse() { DateUnixFormat = 1590144273, WeatherInfo = new WeatherCondition { Temperature = 69.55, Humidity = 50 }, WindData = new Wind { Speed = 9.53 }, WeatherData = new WeatherResponse[] { new WeatherResponse { Icon = "04d" } } }; _mockWeatherForecastResponse = new WeatherForecastResponse() { CityData = new City { Name = "Hamburg", Country = "DE" }, ForecastData = new ForecastResponse[] { new ForecastResponse { DateUnixFormat = 1590559200, WeatherInfo = new WeatherCondition { Temperature = 69.55, Humidity = 50 }, WindData = new Wind() { Speed = 9.53 }, WeatherData = new WeatherResponse[] { new WeatherResponse { Icon = "04d" } } } } }; }
public OpenWeatherMapService(IOptions <OpenWeatherMapConfig> config) : base(config.Value) { _config = config.Value; }
public MockWeatherClient(HttpClient client, OpenWeatherMapConfig config) { _client = client; _config = config; }
public OpenWeatherMapClientParamTest() { _mockConfig = new OpenWeatherMapConfig(); _openWeatherMapClientParam = new OpenWeatherMapClientParam(_mockConfig); }
public OpenWeatherMapService(OpenWeatherMapConfig config) { _config = config; }
public ForecastService(OpenWeatherMapConfig config, IMapper mapper) { _config = config; _mapper = mapper; }