dotMorten / NmeaParser

Library for handling NMEA message in Windows Desktop, Store, Phone, Universal, and Xamarin (Android + iOS), coming from files, bluetooth, serial port or any stream
https://dotmorten.github.io/NmeaParser/
Apache License 2.0
262 stars 89 forks source link

Can't stub messages #80

Closed stealthrabbi closed 4 years ago

stealthrabbi commented 4 years ago

I'm attempting to create stubs/mocks of Nmea messages, e.g. Gga, using Rhino Mocks, but am getting the error as describe dhere. I'm on .NET Framework 4.7.2.

I think this is related to the libraries use of nullables on the Event definition for MessageReceived. I'm not sure how to get around this.

dotMorten commented 4 years ago

I have no experience with RhinoMocks, so could you please provide some more information around what you're doing, how you're doing it, what you expect to work and what error are you getting? "getting the error as describe dhere" isn't very helpful/descriptive.

In any case, mocking hasn't been a focus here - my main issue with mocking is it usually requires you to increase the API surface beyond what is needed in real use, making it a harder to support and understand API. You can always create messages using NmeaMessage.Parse("$GPGGA,,,,,,,,,*00" if you need to create some on the fly. See the unit tests which are doing that.

dotMorten commented 4 years ago

Stale. Closing. Please reopen if you have more details to share.