/* * Yubeshi GPS Parser * * This software is distributed under a zlib-style license. * See license.txt for more information. */ using System; using System.Collections.Generic; using System.Text; using NUnit.Framework; using Yubeshi; using Yubeshi.Nmea; using P = YubeshiTest.Nmea.SamplePackets; namespace YubeshiTest.Nmea { class PacketTest { [Test] public void GpDtmTest() { UnknownPacket packet; Assert.AreEqual(true, GpDtm.TryParse(P.GpDtm, out packet)); GpGga p = packet as GpGga; } [Test] public void GpGgaTest() { UnknownPacket packet; Assert.AreEqual(true, GpGga.TryParse(P.GpGga, out packet)); GpGga p = packet as GpGga; Assert.AreEqual(new TimeSpan(0, 9, 27, 25, 0), p.TimeOfFix); Assert.AreEqual(2837.11399 / 60, p.Position.Latitude); Assert.AreEqual(513.9159 / 60, p.Position.Longitude); } } }