public void GetForecastByZipCodeUri_InvalidInput()
        {
            //Arrange
            var weatherForecastProviderSettingsAccessor = new Mock <IOptions <WeatherForecastProviderSettings> >();
            var logger   = new Mock <ILogger <OpenWeatherForecastUriProvider> >();
            var provider = new OpenWeatherForecastUriProvider(logger.Object, weatherForecastProviderSettingsAccessor.Object);

            //Act
            //Assert
            Assert.Throws <ArgumentNullException>(() => provider.GetForecastByZipCodeUri("", ""), "Invalid input parameters.");
        }
        public void GetForecastByZipCode_ValidInput()
        {
            //Arrange
            var weatherForecastProviderSettingsAccessor = new Mock <IOptions <WeatherForecastProviderSettings> >();

            weatherForecastProviderSettingsAccessor.SetupGet(m => m.Value).Returns(new WeatherForecastProviderSettings
            {
                SearchByZipCodeParameter = "zip",
                UnitsFormat = UnitsFormats.Metric,
                ApiKey      = "somekey",
                BaseAddress = "https://api.openweathermap.org/data/2.5/"
            });
            var logger   = new Mock <ILogger <OpenWeatherForecastUriProvider> >();
            var provider = new OpenWeatherForecastUriProvider(logger.Object, weatherForecastProviderSettingsAccessor.Object);

            Uri expectedResult = new Uri("https://api.openweathermap.org/data/2.5/forecast?zip=20095,de&units=Metric&appid=somekey");

            //Act
            var result = provider.GetForecastByZipCodeUri("20095", "de");

            //Assert
            Assert.AreEqual(expectedResult, result);
        }