Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues with Swiss Francs #96

Closed
wants to merge 1 commit into from
Closed

Conversation

emrgee
Copy link

@emrgee emrgee commented Apr 14, 2023

  • ToString/Parse round-trip failed because of '.' in "fr." (and possibly other currencies with a '.' in their symbol)

  • replaced unused/outdated symbol "fr." by "CHF"

  • added NodaMoney.CurrencySymbolParser, provided unit tests

  • added NodaMoney.Tests.Helpers.CultureNames with constants used by several unit tests

  • added NodaMoney.Currency.GetCurrencies(string symbol) with a cached lookup

  • modified NodaMoney.CurrencyRegistry

    • made static fields into instance fields
    • introduced helper method GetKey
    • removes namespace when empty
    • maintains a lookup for currency resolution by symbol
    • added GetCurrencies(string symbol)
  • reworked NodaMoney.Money.ExtractCurrencyFromString

    • replaced insufficient IsNotNumericCharacter by CurrencySymbolParser.Parse
    • replaced inefficient Currency.GetAllCurrencies().Where(...) by Currency.GetCurrencies(symbol) and Currency.Registry.TryGet(code)
  • added NodaMoney.Tests.MoneyFormattableSpec.GivenIWantMoneyAsString._swissFranc and corresponding unit tests

  • added NodaMoney.Tests.MoneyFormattableSpec.GivenIWantMoneyAsStringWithCurrencySymbol._swissFranc and corresponding unit tests

  • added NodaMoney.Tests.MoneyFormattableSpec.GivenIWantMoneyAsStringWithCurrencyCode._swissFranc and corresponding unit tests

  • added NodaMoney.Tests.MoneyFormattableSpec.GivenIWantMoneyAsStringWithEnglishCurrencyName._swissFranc and corresponding unit tests

  • modified unit tests in NodaMoney.Tests.MoneyParsableSpec

    • unified naming and setup
    • added unit tests related to Swiss Francs

- ToString/Parse round-trip failed because of '.' in "fr." (and possibly other currencies with a '.' in their symbol)
- replaced unused/outdated symbol "fr." by "CHF"

- added NodaMoney.CurrencySymbolParser, provided unit tests
- added NodaMoney.Tests.Helpers.CultureNames with constants used by several unit tests
- added NodaMoney.Currency.GetCurrencies(string symbol) with a cached lookup
- modified NodaMoney.CurrencyRegistry
  - made static fields into instance fields
  - introduced helper method GetKey
  - removes namespace when empty
  - maintains a lookup for currency resolution by symbol
  - added GetCurrencies(string symbol)
- reworked NodaMoney.Money.ExtractCurrencyFromString
  - replaced insufficient IsNotNumericCharacter by CurrencySymbolParser.Parse
  - replaced inefficient Currency.GetAllCurrencies().Where(...) by Currency.GetCurrencies(symbol) and Currency.Registry.TryGet(code)
- added NodaMoney.Tests.MoneyFormattableSpec.GivenIWantMoneyAsString._swissFranc and corresponding unit tests
- added NodaMoney.Tests.MoneyFormattableSpec.GivenIWantMoneyAsStringWithCurrencySymbol._swissFranc and corresponding unit tests
- added NodaMoney.Tests.MoneyFormattableSpec.GivenIWantMoneyAsStringWithCurrencyCode._swissFranc and corresponding unit tests
- added NodaMoney.Tests.MoneyFormattableSpec.GivenIWantMoneyAsStringWithEnglishCurrencyName._swissFranc and corresponding unit tests
- modified unit tests in NodaMoney.Tests.MoneyParsableSpec
  - unified naming and setup
  - added unit tests related to Swiss Francs
@RemyDuijkeren RemyDuijkeren added this to the v2.0 milestone Feb 14, 2025
@RemyDuijkeren RemyDuijkeren self-assigned this Feb 14, 2025
RemyDuijkeren added a commit that referenced this pull request Feb 16, 2025
Cherry pick from Pull Request #96. ToString/Parse round-trip failed because of '.' in "fr." (and possibly other currencies with a '.' in their symbol), replaced unused/outdated symbol "fr." by "CHF", added unit tests related to Swiss Francs, new parsing symbol from string
@RemyDuijkeren RemyDuijkeren self-requested a review February 16, 2025 05:50
@RemyDuijkeren
Copy link
Owner

Cherry picked Pull Request into e9ea404

Sorry for the long delay. Nice findings and solutions. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants