diff --git a/NMoneys.nuspec b/NMoneys.nuspec index c8fa4dd..fa2f271 100644 --- a/NMoneys.nuspec +++ b/NMoneys.nuspec @@ -3,7 +3,7 @@ NMoneys NMoneys - 5.1.0.0 + 5.1.1.0 Daniel González García http://www.opensource.org/licenses/bsd-license.php false diff --git a/src/NMoneys.Tests/CurrencyTester.cs b/src/NMoneys.Tests/CurrencyTester.cs index 979a134..0cc9840 100644 --- a/src/NMoneys.Tests/CurrencyTester.cs +++ b/src/NMoneys.Tests/CurrencyTester.cs @@ -155,11 +155,6 @@ public void ObsoleteCurrencies_AreConsistent() // all currency codes are marked as obsolete Assert.That(obsoleteCodes, Has.All.Matches(Enumeration.HasAttribute)); - - // there no more currency codes marked as obsolete than obsolete currencies - Assert.That(obsoleteCodes, Is.EquivalentTo( - Enumeration.GetValues() - .Where(Enumeration.HasAttribute))); } #pragma warning restore 169 diff --git a/src/NMoneys/Currencies.xml b/src/NMoneys/Currencies.xml index fd173ef..38e50ae 100644 --- a/src/NMoneys/Currencies.xml +++ b/src/NMoneys/Currencies.xml @@ -289,6 +289,7 @@ 3 3 8 + true Belize Dollar diff --git a/src/NMoneys/CurrencyIsoCode.cs b/src/NMoneys/CurrencyIsoCode.cs index 2bf0ff6..f3d89f8 100644 --- a/src/NMoneys/CurrencyIsoCode.cs +++ b/src/NMoneys/CurrencyIsoCode.cs @@ -142,7 +142,7 @@ public enum CurrencyIsoCode : short /// /// Belarussian Ruble /// - [EnumMember, CanonicalCulture("be-BY")] + [EnumMember, CanonicalCulture("be-BY"), Obsolete("deprecated in favor of BYN")] BYR = 974, /// /// Belize Dollar diff --git a/src/NMoneys/ObsoleteCurrencies.cs b/src/NMoneys/ObsoleteCurrencies.cs index 21a9f42..5c36792 100644 --- a/src/NMoneys/ObsoleteCurrencies.cs +++ b/src/NMoneys/ObsoleteCurrencies.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; +using System.Linq; using NMoneys.Support; namespace NMoneys @@ -13,15 +14,12 @@ internal static class ObsoleteCurrencies private static readonly HashSet _set; static ObsoleteCurrencies() { -#pragma warning disable 612,618 - _set = new HashSet(FastEnumComparer.Instance) - { - CurrencyIsoCode.EEK, - CurrencyIsoCode.ZMK, - CurrencyIsoCode.LVL, - CurrencyIsoCode.LTL, - }; -#pragma warning restore 612,618 + var obsoleteCodes = Enumeration.GetValues() + .Where(Enumeration.HasAttribute); + + _set = new HashSet( + obsoleteCodes, + FastEnumComparer.Instance); } [Pure] @@ -37,6 +35,6 @@ public static bool IsObsolete(Currency currency) } [Pure] - public static uint Count => Convert.ToUInt32(_set.Count); + public static ushort Count => Convert.ToUInt16(_set.Count); } } \ No newline at end of file diff --git a/src/NMoneys/Properties/NMoneys_AssemblyInfo.cs b/src/NMoneys/Properties/NMoneys_AssemblyInfo.cs index 01cc6c0..11c274d 100644 --- a/src/NMoneys/Properties/NMoneys_AssemblyInfo.cs +++ b/src/NMoneys/Properties/NMoneys_AssemblyInfo.cs @@ -26,5 +26,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("5.1.0.0")] -[assembly: AssemblyFileVersion("5.1.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("5.1.1.0")] +[assembly: AssemblyFileVersion("5.1.1.0")] \ No newline at end of file