Exemplo n.º 1
0
        public void TestGetCities_It_Shoud_Throw_Argument_Exception_If_Parameter_Country_IsNull_Or_Empty()
        {
            //Setup
            WebServicexGlobalWeatherProvider _provider = new WebServicexGlobalWeatherProvider();

            //Act
            var result = _provider.GetCities("");
        }
Exemplo n.º 2
0
        public void TestGetWeather_It_Shoud_Throw_Exception_If_Country_Is_Unknown()
        {
            //Setup
            WebServicexGlobalWeatherProvider _provider = new WebServicexGlobalWeatherProvider();
            City city = new City {
                Country = "Unknown", Name = "Sydney"
            };

            //Act
            var result = _provider.GetWeather(city);
        }
Exemplo n.º 3
0
        public void TestGetCities_It_Shoud_Return_Empty_List_If_We_Pass_Invalid_CountryName()
        {
            //Setup
            WebServicexGlobalWeatherProvider _provider = new WebServicexGlobalWeatherProvider();

            //Act
            var result = _provider.GetCities("Unknown Country");

            //Assert
            Assert.AreEqual(0, result.Count);
        }
Exemplo n.º 4
0
        public void TestGetCities_It_Should_Return_List_Of_Cities_Correspondng_To_Country()
        {
            //Setup
            WebServicexGlobalWeatherProvider _provider = new WebServicexGlobalWeatherProvider();

            //Act
            var result = _provider.GetCities("Australia");

            //Assert
            Assert.IsNotNull(result);
            Assert.AreNotEqual(result.Count, 0);
        }
Exemplo n.º 5
0
        public void TestGetCities_it_should_return_list_of_all_countries()
        {
            //Setup
            WebServicexGlobalWeatherProvider _provider = new WebServicexGlobalWeatherProvider();

            //Act
            var result = _provider.GetCountries();

            //Assert
            Assert.IsNotNull(result);
            Assert.AreNotEqual(result.Count, 0);
        }
Exemplo n.º 6
0
        public void TestGetWeather_It_Shoud_Return_Weather_Parameters()
        {
            //Setup
            WebServicexGlobalWeatherProvider _provider = new WebServicexGlobalWeatherProvider();
            City city = new City {
                Country = "Australia", Name = "Sydney"
            };

            //Act
            var result = _provider.GetWeather(city);

            //Assert
            Assert.AreNotEqual(null, result);
        }