Пример #1
0
        public void Forecast_For_Timbuktu_Returns_Error()
        {
            // Arrange
            var sut = new WeatherService();

            // Act
            Assert.Throws<HttpRequestException>(() => sut.GetForecast("SA", "Timbuktu"));
        }
Пример #2
0
        static void Main(string[] args)
        {
            var service = new WeatherService();

            var forecast = service.GetForecast("SA", "Adelaide");

            Console.WriteLine(forecast.Items.First().Description);
            Console.ReadLine();
        }
Пример #3
0
        static void Main()
        {
            var provider = new WebForecastProvider();
            var service = new WeatherService(provider);

            var forecast = service.GetForecast("SA", "Adelaide");

            Console.WriteLine(forecast.Items.First().Description);
            Console.ReadLine();
        }
Пример #4
0
        public void Forecast_For_Adelaide_Returns_Result()
        {
            // Arrange
            var sut = new WeatherService();

            // Act
            var result = sut.GetForecast("SA", "Adelaide");

            // Assert
            Assert.That(result.Items.First().Description.StartsWith(@"<b>Wednesday 29</b><br/>Partly cloudy."), "Forecast is incorrect");
        }