2006-11-02 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.Web.Services / Test / standalone / client / external / GlobalWeatherTest.cs
1 // Web service test for WSDL document:
2 // http://live.capescience.com/wsdl/GlobalWeather.wsdl
3
4 using System;
5 using NUnit.Framework;
6 using GlobalWeatherTests.Soap;
7
8 namespace External.GlobalWeatherTests
9 {
10         [TestFixture]
11         public class GlobalWeatherTest: WebServiceTest
12         {
13                 // CapeConnect / RPC
14                         
15                 [Test]
16                 public void TestStationInfo ()
17                 {
18                         StationInfo si = new StationInfo ();
19                         string[] countries = si.listCountries ();
20                         Assert.IsNotNull (countries);
21                         Assert.AreEqual (215, countries.Length);
22                         Assert.AreEqual ("afghanistan", countries[0]);
23                         Assert.AreEqual ("spain", countries[177]);
24                         Assert.AreEqual ("zimbabwe", countries[214]);
25                         
26                         Station[] stations = si.searchByCountry ("spain");
27                         Assert.IsNotNull (stations);
28                         foreach (Station sta in stations)
29                         {
30                                 Assert.IsNotNull (sta);
31                                 if (sta.icao == "LEBL")
32                                         Assert.AreEqual ("Barcelona / Aeropuerto", sta.name);
33                         }
34                         
35                         Station[] st = si.searchByCode ("LEBL");
36                         Assert.IsNotNull (st);
37                         Assert.AreEqual (1, st.Length);
38                         Assert.AreEqual ("Barcelona / Aeropuerto", st[0].name);
39                 }
40                 
41                 [Test]
42                 public void TestGlobalWeather ()
43                 {
44                         GlobalWeather gw = new GlobalWeather ();
45                         WeatherReport wr = gw.getWeatherReport ("LEBL");
46                         
47                         Assert.IsNotNull (wr.station);
48                         Assert.AreEqual ("LEBL", wr.station.icao);
49                         Assert.AreEqual ("Barcelona / Aeropuerto", wr.station.name);
50                 }
51         }
52 }