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
I have been using the library and have found that I get errors randomly on first use.
I believe I have tracked this down to a race condition in the CurrencyRegistry when constructing the list of currencies. If the currency is not returned it uses the CurrentCulture's currency, which in my case is AUD, but usually using USD in this app.
If you run all tests you'll find that random parse tests fail, this is a symptom of the race problem.
Example test output:
NodaMoney.Tests.MoneyParsableSpec.GivenIWantToTryParseImplicitCurrency.WhenParsingDollarSymbolInArgentina_ThenThisShouldReturnArgentinePeso
Source: MoneyParsableSpec.cs line 363
Duration: 3 ms
Message:
NodaMoney.InvalidCurrencyException : The requested operation expected the currency AUD, but the actual value was the currency ARS!
Stack Trace:
Money.AssertIsSameCurrency(Money left, Money right) line 297
Money.CompareTo(Money other) line 122
ComparableTypeAssertions`1.Be(T expected, String because, Object[] becauseArgs)
GivenIWantToTryParseImplicitCurrency.WhenParsingDollarSymbolInArgentina_ThenThisShouldReturnArgentinePeso() line 368
The text was updated successfully, but these errors were encountered:
I have been using the library and have found that I get errors randomly on first use.
I believe I have tracked this down to a race condition in the CurrencyRegistry when constructing the list of currencies. If the currency is not returned it uses the CurrentCulture's currency, which in my case is AUD, but usually using USD in this app.
If you run all tests you'll find that random parse tests fail, this is a symptom of the race problem.
Example test output:
The text was updated successfully, but these errors were encountered: