diff --git a/Source/Singulink.Globalization.Currency/SortedMoneySet.cs b/Source/Singulink.Globalization.Currency/SortedMoneySet.cs index c709124..065c994 100644 --- a/Source/Singulink.Globalization.Currency/SortedMoneySet.cs +++ b/Source/Singulink.Globalization.Currency/SortedMoneySet.cs @@ -647,7 +647,7 @@ private void ThrowCurrenciesDisallowed(List currencies, string paramNa #endif /// - bool IReadOnlyMoneySet.IsSorted => false; + bool IReadOnlyMoneySet.IsSorted => true; /// bool ICollection.IsReadOnly => false; diff --git a/Tests/Singulink.Globalization.Currency.Tests/MoneySetTests/IsSorted.cs b/Tests/Singulink.Globalization.Currency.Tests/MoneySetTests/IsSorted.cs new file mode 100644 index 0000000..2c7e694 --- /dev/null +++ b/Tests/Singulink.Globalization.Currency.Tests/MoneySetTests/IsSorted.cs @@ -0,0 +1,25 @@ +namespace Singulink.Globalization.Tests.MoneySetTests; + +[PrefixTestClass] +public class IsSorted +{ + [TestMethod] + public void Sorted_UnsortedSets_IsFalse() + { + IReadOnlyMoneySet sortedMoneySet = new MoneySet(); + IReadOnlyMoneySet immutableSortedMoneySet = ImmutableMoneySet.Create(); + + sortedMoneySet.IsSorted.ShouldBeFalse(); + immutableSortedMoneySet.IsSorted.ShouldBeFalse(); + } + + [TestMethod] + public void Sorted_SortedSets_IsTrue() + { + IReadOnlyMoneySet sortedMoneySet = new SortedMoneySet(); + IReadOnlyMoneySet immutableSortedMoneySet = ImmutableSortedMoneySet.Create(); + + sortedMoneySet.IsSorted.ShouldBeTrue(); + immutableSortedMoneySet.IsSorted.ShouldBeTrue(); + } +} \ No newline at end of file