Example #1
0
        public void BadStationObsTest()
        {
            NOAAMetarService noaa = new NOAAMetarService();

            Task<Metar> theMetar = noaa.GetCurrentObsAsync("XXXX");

            Assert.IsTrue(theMetar.Result == null);
        }
Example #2
0
        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());
        }
Example #3
0
       /* 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;
            }
        }
Example #4
0
        public void CurrentKAWOObsTest()
        {
            NOAAMetarService noaa = new NOAAMetarService();

            Task<Metar> theMetar = noaa.GetCurrentObsAsync("KAWO");

            Assert.AreEqual<string>("KAWO", theMetar.Result.GetStation());
        }
Example #5
0
        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);
        }