public void GetCurrentWeatherByZipCodeUri_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.GetCurrentWeatherByZipCodeUri("", ""), "Invalid input parameters.");
        }
        public void GetCurrentWeatherByZipCode_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/weather?zip=20095,de&units=Metric&appid=somekey");

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

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