Skip to content

Commit

Permalink
Add IsSorted tests and fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Giura-Paul authored and mikernet committed Mar 8, 2024
1 parent a9a52c2 commit 136d784
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Singulink.Globalization.Currency/SortedMoneySet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ private void ThrowCurrenciesDisallowed(List<Currency> currencies, string paramNa
#endif

/// <inheritdoc/>
bool IReadOnlyMoneySet.IsSorted => false;
bool IReadOnlyMoneySet.IsSorted => true;

/// <inheritdoc/>
bool ICollection<Money>.IsReadOnly => false;
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}
}

0 comments on commit 136d784

Please sign in to comment.