-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
makes Currency implement ICurrency from TeixeiraSoftware.Finance.Money
- Loading branch information
André Marcondes Teixeira
committed
Feb 23, 2018
1 parent
351564d
commit bb765b7
Showing
11 changed files
with
334 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/TeixeiraSoftware/Finance/CurrencyIComparableImplementation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
|
||
namespace TeixeiraSoftware.Finance | ||
{ | ||
public partial class Currency : ICurrency | ||
{ | ||
/// <summary> | ||
/// Compares two currencies for sorting purposes | ||
/// </summary> | ||
/// <param name="other"></param> | ||
/// <returns> | ||
/// -1 if this current currency comes before the other currency. | ||
/// 0 if this current currency is equal to the other currency. | ||
/// 1 if this current currency comes after the other currency. | ||
/// </returns> | ||
public override int CompareTo(object other) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
/// <summary> | ||
/// Compares two currencies for sorting purposes | ||
/// </summary> | ||
/// <param name="other"></param> | ||
/// <returns> | ||
/// -1 if this current currency comes before the other currency. | ||
/// 0 if this current currency is equal to the other currency. | ||
/// 1 if this current currency comes after the other currency. | ||
/// </returns> | ||
public override int CompareTo(ICurrency other) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/TeixeiraSoftware/Finance/CurrencyIEquatableImplementation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace TeixeiraSoftware.Finance | ||
{ | ||
public partial class Currency : ICurrency | ||
{ | ||
/// <summary>Compares the equality of two currencies.</summary> | ||
/// <remarks> | ||
/// The instances of <see cref="Currency" /> class are compared through their | ||
/// whole set of properties. | ||
/// </remarks> | ||
/// <param name="currency">An instance of <see cref="Currency" /></param> | ||
public override bool Equals(object currency) | ||
{ | ||
return AreEquivalent(this, (ICurrency)currency); | ||
} | ||
|
||
/// <summary>Compares the equality of two currencies.</summary> | ||
/// <remarks> | ||
/// The instances of <see cref="ICurrency" /> class are compared through their | ||
/// whole set of properties. | ||
/// </remarks> | ||
/// <param name="currency">An instance of <see cref="ICurrency" /></param> | ||
public override bool Equals(ICurrency currency) | ||
{ | ||
return AreEquivalent(this, currency); | ||
} | ||
|
||
/// <remarks>The hash code is taken from the base class Object.</remarks> | ||
public override int GetHashCode() | ||
{ | ||
return base.GetHashCode(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.