OSDN Git Service

c5591bbcf1f284c4190efbf72c8df345ccbdec99
[yubeshi/yubeshi.git] / YubeshiTest / Nmea / PacketTest.cs
1 /*\r
2  *      Yubeshi GPS Parser\r
3  *\r
4  *      This software is distributed under a zlib-style license.\r
5  *      See license.txt for more information.\r
6  */\r
7 \r
8 using System;\r
9 using System.Collections.Generic;\r
10 using System.Text;\r
11 using NUnit.Framework;\r
12 using Yubeshi.Nmea;\r
13 using P = YubeshiTest.Nmea.SamplePackets;\r
14 \r
15 namespace YubeshiTest.Nmea\r
16 {\r
17 \r
18     class PacketTest\r
19     {\r
20 \r
21         [Test]\r
22         public void GpDtmTest()\r
23         {\r
24             Packet p;\r
25             GpDtm.TryParse(P.GpDtm, out p);\r
26         }\r
27 \r
28         [Test]\r
29         public void GpGgaTest()\r
30         {\r
31             Packet packet;\r
32             Assert.AreEqual(true, GpGga.TryParse(P.GpGga, out packet));\r
33             GpGga p = packet as GpGga;\r
34             Assert.AreEqual(new TimeSpan(0, 9, 27, 25, 0), p.TimeOfFix);\r
35             Assert.AreEqual(2837.11399m / 60m, p.Position.Latitude);\r
36             Assert.AreEqual(513.9159m / 60m, p.Position.Longitude);\r
37         }\r
38     }\r
39 }\r