public void ReturnsNullNoSuchElement() { var sentence1 = new HeadingTrue(10.2); _sink.Raise(x => x.OnNewSequence += null, null, sentence1); Assert.Null(_cache.GetLastSentence(HeadingMagnetic.Id)); }
public void HdtEncode() { string msg = "99.9,T"; NmeaSentence.OwnTalkerId = TalkerId.GlobalPositioningSystem; HeadingTrue mwv = new HeadingTrue(99.9); Assert.True(mwv.Valid); Assert.Equal(msg, mwv.ToNmeaParameterList()); }
public void CacheKeepsLastElement() { var sentence1 = new HeadingTrue(10.2); var sentence2 = new HeadingTrue(-1); _sink.Raise(x => x.OnNewSequence += null, null, sentence1); _sink.Raise(x => x.OnNewSequence += null, null, sentence2); Assert.Equal(sentence2, _cache.GetLastSentence(HeadingTrue.Id)); }
public void HdtDecode() { string msg = "$GPHDT,99.9,T"; var decoded = TalkerSentence.FromSentenceString(msg, out var error); Assert.Equal(NmeaError.None, error); Assert.NotNull(decoded); HeadingTrue xte = (HeadingTrue)decoded !.TryGetTypedValue(ref _lastPacketTime) !; Assert.True(xte.Valid); Assert.Equal(99.9, xte.Angle.Degrees, 1); }