public void TestGetCityList()
        {
            WeatherAppBusinessLogic objBL = new WeatherAppBusinessLogic();
            var cityList = objBL.GetCityList();

            Assert.IsTrue(cityList.Count > 0);
        }
        public void TestGetWeatherByCityID()
        {
            WeatherAppBusinessLogic objBL = new WeatherAppBusinessLogic();
            var cityList = objBL.GetCityList();

            var weatherDetails = objBL.GetWeatherDetailsById(cityList);

            Assert.AreEqual(cityList.Count, weatherDetails.Result.Count);
        }
        public void TestSaveWeatherDetailstoFiles()
        {
            var expectedMessage = "Files Saved successfully!!!";

            WeatherAppBusinessLogic objBL = new WeatherAppBusinessLogic();
            var cityList = objBL.GetCityList();

            var weatherDetails = objBL.GetWeatherDetailsById(cityList).Result;


            var actualMessage = WeatherApplication.Program.SaveWeatherDetailstoFiles(weatherDetails);

            Assert.AreEqual(expectedMessage, actualMessage, true);
        }
Пример #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Weather Application Started:");
            WeatherAppBusinessLogic objBL = new WeatherAppBusinessLogic();
            // Getting list of cities
            var cityList = objBL.GetCityList();

            // Getting weather details
            var weatherDetails = objBL.GetWeatherDetailsById(cityList).Result;

            // Saving weatherDetails to Json
            var message = SaveWeatherDetailstoFiles(weatherDetails);

            Console.WriteLine(message);

            Console.ReadLine();
        }