1 // Web service test for WSDL document:
2 // http://live.capescience.com/wsdl/GlobalWeather.wsdl
6 using GlobalWeatherTests.Soap;
8 namespace External.GlobalWeatherTests
11 public class GlobalWeatherTest: WebServiceTest
16 public void TestStationInfo ()
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]);
26 Station[] stations = si.searchByCountry ("spain");
27 Assert.IsNotNull (stations);
28 foreach (Station sta in stations)
30 Assert.IsNotNull (sta);
31 if (sta.icao == "LEBL")
32 Assert.AreEqual ("Barcelona / Aeropuerto", sta.name);
35 Station[] st = si.searchByCode ("LEBL");
36 Assert.IsNotNull (st);
37 Assert.AreEqual (1, st.Length);
38 Assert.AreEqual ("Barcelona / Aeropuerto", st[0].name);
42 public void TestGlobalWeather ()
44 GlobalWeather gw = new GlobalWeather ();
45 WeatherReport wr = gw.getWeatherReport ("LEBL");
47 Assert.IsNotNull (wr.station);
48 Assert.AreEqual ("LEBL", wr.station.icao);
49 Assert.AreEqual ("Barcelona / Aeropuerto", wr.station.name);