コード例 #1
0
        public async Task TestMethod1()
        {
            string xmlResponse = await WeatherConnection.LoadWeatherAsync("Wroclaw");

            Weather result;

            using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(xmlResponse)))
            {
                result = ParseWeatherXML.Parse(stream);
            }

            Assert.AreEqual("Wroclaw", result.City);
        }
コード例 #2
0
        public async Task ParseTestAsync()
        {
            string responseXML = await WeatherConnection.LoadDataAsync("London");

            WeatherDataEntry result;

            using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(responseXML)))
            {
                result = ParseWeather_XmlReader.Parse(stream);
            }

            Assert.IsNotNull(result.City);
        }
コード例 #3
0
        public async Task LoadForecastAsyncTestAsync()
        {
            string responseXML = await WeatherConnection.LoadForecastAsync("London");

            Assert.IsNotNull(responseXML);
        }