Skip to content

Commit

Permalink
solve issues after design changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dgg committed Dec 15, 2017
1 parent b2ce3fb commit 6ea0f7f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/NMoneys.Tests/Support/EnumerationTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ public void Comparer_NotEqual_False()
[Test]
public void Comparer_NotEnum_Throws()
{
Assert.That(() => Enumeration.Comparer<int>.Instance, Throws.ArgumentException);
Assert.That(() => Enumeration.Comparer<int>.Instance, Throws.InstanceOf<TypeInitializationException>().With
.InnerException.TypeOf<ArgumentException>());
}

#endregion
Expand Down
4 changes: 2 additions & 2 deletions src/NMoneys/Allocations/Allocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace NMoneys.Allocations
/// <summary>
/// Represents the allocated of an allocation operation.
/// </summary>
/// <seealso cref="Money.Allocate(int, IRemainderAllocator)"/>
/// <seealso cref="Money.Allocate(RatioCollection, IRemainderAllocator)"/>
/// <seealso cref="AllocateOperations.Allocate(Money, int, IRemainderAllocator)"/>
/// <seealso cref="AllocateOperations.Allocate(Money, RatioCollection, IRemainderAllocator)"/>
/// <seealso cref="EvenAllocator.Allocate(int)"/>
/// <seealso cref="ProRataAllocator.Allocate(RatioCollection)"/>
public class Allocation : IEnumerable<Money>, IFormattable
Expand Down
3 changes: 1 addition & 2 deletions src/NMoneys/Allocations/IRemainderAllocator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections.Generic;

namespace NMoneys.Allocations
{
Expand Down Expand Up @@ -27,7 +26,7 @@ public interface IRemainderAllocator
/// At the end of the distribution, the resulting allocation should, most of the times, be complete (nothing else to allocate).
/// But it does not have to be like that. If the remaining amount is too small to be allocated, it will remain a remainder.
/// <para>Implementors will increase the amounts used to generate the returning <see cref="Allocation"/> according to whichever strategy is chosen to distribute the remainder of <paramref name="allocationSoFar"/>.</para>
/// <para>It may not be called at all if the money can be evenly distributed in <see cref="Money.Allocate(int)"/> or <see cref="Money.Allocate(RatioCollection)"/>.</para>
/// <para>It may not be called at all if the money can be evenly distributed in <see cref="AllocateOperations.Allocate(Money, int)"/> or <see cref="AllocateOperations.Allocate(Money, RatioCollection)"/>.</para>
/// </remarks>
/// <param name="allocationSoFar">Contains the remainder amount that might need to be allocated or <see cref="Money.Zero()"/> if no remainder is left.
/// <para>It also contains the evenly allocated amounts (if any).</para>
Expand Down
3 changes: 3 additions & 0 deletions src/NMoneys/Allocations/Operations.Allocate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

namespace NMoneys.Allocations
{
/// <summary>
/// Extension class that gives access to extensions methods related to money allocation.
/// </summary>
public static class AllocateOperations
{
/// <summary>
Expand Down
7 changes: 7 additions & 0 deletions src/NMoneys/CurrencyIsoCode.Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ public static Currency AsCurrency(this CurrencyIsoCode isoCode)
return Currency.Get(isoCode);
}

/// <summary>
/// Determines whether the specified objects are equal.
/// </summary>
/// <remarks>Is checks euqality in a performant manner, regardless of the framework version.</remarks>
/// <param name="code">The first object of type <see cref="CurrencyIsoCode"/> to compare.</param>
/// <param name="other">The second object of type <see cref="CurrencyIsoCode"/> to compare.</param>
/// <returns>true if the specified objects are equal; otherwise, false.</returns>
public static bool Equals(this CurrencyIsoCode code, CurrencyIsoCode other)
{
return Currency.Code.Comparer.Equals(code, other);
Expand Down

0 comments on commit 6ea0f7f

Please sign in to comment.