mirror of
https://github.com/dotMorten/NmeaParser.git
synced 2026-04-05 22:45:42 +00:00
Fixes #42
This commit is contained in:
parent
e9ea4ef1c3
commit
a648721ba8
2 changed files with 90 additions and 0 deletions
|
|
@ -588,5 +588,31 @@ namespace NmeaParser.Tests
|
|||
Assert.AreEqual(0.020, gst.SigmaLongitudeError);
|
||||
Assert.AreEqual(0.031, gst.SigmaHeightError);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpvtg()
|
||||
{
|
||||
string input = "$GPVTG,103.85,T,92.79,M,0.14,N,0.25,K,D*1E";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpvtg));
|
||||
Gpvtg vtg = (Gpvtg)msg;
|
||||
Assert.AreEqual(103.85, vtg.TrueCourseOverGround);
|
||||
Assert.AreEqual(92.79, vtg.MagneticCourseOverGround);
|
||||
Assert.AreEqual(0.14, vtg.SpeedInKnots);
|
||||
Assert.AreEqual(0.25, vtg.SpeedInKph);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGpvtg_Empty()
|
||||
{
|
||||
string input = "$GPVTG,,T,,M,0.00,N,0.00,K*4E";
|
||||
var msg = NmeaMessage.Parse(input);
|
||||
Assert.IsInstanceOfType(msg, typeof(Gpvtg));
|
||||
Gpvtg vtg = (Gpvtg)msg;
|
||||
Assert.IsTrue(double.IsNaN(vtg.TrueCourseOverGround));
|
||||
Assert.IsTrue(double.IsNaN(vtg.MagneticCourseOverGround));
|
||||
Assert.AreEqual(0.0, vtg.SpeedInKnots);
|
||||
Assert.AreEqual(0.0, vtg.SpeedInKph);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue