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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant