public void BadStationObsTest() { NOAAMetarService noaa = new NOAAMetarService(); Task<Metar> theMetar = noaa.GetCurrentObsAsync("XXXX"); Assert.IsTrue(theMetar.Result == null); }
public void ConformOnlyAlpha() { NOAAMetarService noaa = new NOAAMetarService(); Task<Metar> theMetar = noaa.GetCurrentObsAsync("KBFI"); string rawMetar = theMetar.Result.GetRawMetar(); //rawMetar. Assert.AreEqual<string>("KBFI", theMetar.Result.GetStation()); }
/* public Task GetCurrentObsAsync() { // Task t = new Task(GetCurrentObsAsyncWorker); // t.Start(); // return t; } */ public async Task GetCurrentObsAsyncWorker() { NOAAMetarService service = new NOAAMetarService(); Metar m = await service.GetCurrentObsAsync(StationID); if (m != null) { LocalMetar.EncodedDescription = m.EncodedDescription; } }
public void CurrentKAWOObsTest() { NOAAMetarService noaa = new NOAAMetarService(); Task<Metar> theMetar = noaa.GetCurrentObsAsync("KAWO"); Assert.AreEqual<string>("KAWO", theMetar.Result.GetStation()); }
public void ParseLineTest() { string line = @"000 SAUS70 KWBC 030000 RRC MTRBFI METAR KBFI 022353Z 22010G15KT 10SM FEW040 BKN080 18/07 A2993 RMK AO2 SLP134 T01830072 10189 20144 50001"; NOAAMetarService noaa = new NOAAMetarService(); string result = noaa.ParseResultForMetarLine(line); Assert.AreEqual<string>("METAR KBFI 022353Z 22010G15KT 10SM FEW040 BKN080 18/07 A2993 RMK AO2 SLP134 T01830072 10189 20144 50001", result); }