Skip to content

Commit

Permalink
Refactor remaining tests, add IReadOnlyMoneySet.IsSorted
Browse files Browse the repository at this point in the history
  • Loading branch information
mikernet committed Mar 7, 2024
1 parent 6f60a5e commit 268ce45
Show file tree
Hide file tree
Showing 70 changed files with 1,923 additions and 1,735 deletions.
15 changes: 10 additions & 5 deletions Source/Singulink.Globalization.Currency/IReadOnlyMoneySet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ public interface IReadOnlyMoneySet : IEnumerable<Money>, IFormattable
/// </summary>
public Money this[Currency currency] { get; }

/// <summary>
/// Gets the currency registry associated with this set.
/// </summary>
CurrencyRegistry Registry { get; }

/// <summary>
/// Gets the number of values in this set.
/// </summary>
Expand All @@ -43,6 +38,16 @@ public interface IReadOnlyMoneySet : IEnumerable<Money>, IFormattable
/// </summary>
public IEnumerable<Currency> Currencies { get; }

/// <summary>
/// Gets a value indicating whether this set is sorted by each value's currency code.
/// </summary>
public bool IsSorted { get; }

/// <summary>
/// Gets the currency registry associated with this set.
/// </summary>
CurrencyRegistry Registry { get; }

/// <summary>
/// Gets the amount associated with the specified currency.
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions Source/Singulink.Globalization.Currency/ImmutableMoneySet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ static void Throw(CurrencyRegistry registry, Currency currency, string paramName

#endif

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

/// <inheritdoc/>
IImmutableMoneySet IImmutableMoneySet.Add(Money value) => Add(value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ static void Throw(CurrencyRegistry registry, Currency currency, string paramName

#endif

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

/// <inheritdoc/>
IImmutableMoneySet IImmutableMoneySet.Add(Money value) => Add(value);

Expand Down
3 changes: 3 additions & 0 deletions Source/Singulink.Globalization.Currency/MoneySet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,9 @@ private void ThrowCurrenciesDisallowed(List<Currency> currencies, string paramNa

#endif

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

/// <inheritdoc/>
IEnumerable<Currency> IReadOnlyMoneySet.Currencies => Currencies;

Expand Down
7 changes: 1 addition & 6 deletions Source/Singulink.Globalization.Currency/MoneySetBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

namespace Singulink.Globalization;

Expand Down
3 changes: 3 additions & 0 deletions Source/Singulink.Globalization.Currency/SortedMoneySet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,9 @@ private void ThrowCurrenciesDisallowed(List<Currency> currencies, string paramNa

#endif

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

/// <inheritdoc/>
IEnumerable<Currency> IReadOnlyMoneySet.Currencies => Currencies;

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 268ce45

Please sign in to comment.