You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On my machine, that test fails on second assertion because of Namespace being null.
I think we're on different version. I use NuGet package NodaMoney 1.0.5 released on 29/8/2018 corresponding to commit 5ee1065. In that version, the Currency struct is marked with DataContractAttribute and it looks like Newtonsoft.Json is using that to (de)serialize Code property only. Maybe you test with master branch; it includes commit 3c0d3e0, in which some serialization changes were made.
Why couldn't those properties be null? Number and Symbol are strings, ValidFrom and ValidTo are nullable dates.
Take a
Currency
object and do a serialization roundtrip. The resulting object contains onlyCode
property value, the others are on default values:Using the deserialized
result
currency to construct aMoney
does not work well:It looks like a bug. Or am I missing anything? A
Money
object survives serialization roundtrip without any problems.Environment:
.NET 6
NodaMoney 1.0.5
Newtownsoft.Json 13.0.1
The text was updated successfully, but these errors were encountered: