-
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.
* Updated readme * Moved application into src directory * Added customer unit tests * Added product tests * Added money unit tests * Added Sku unit tests * Added Order unit tests * Build now runs tests * Fixed warnings * Update action permissions * Tidied up permission check * Added build badge
- Loading branch information
1 parent
97d5a6a
commit e932efb
Showing
110 changed files
with
1,094 additions
and
90 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 was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,52 @@ | ||
ο»Ώusing DDD.Domain.Common.Extensions; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace DDD.Domain.Common.Exceptions; | ||
|
||
public class DomainException : Exception | ||
{ | ||
public DomainException() | ||
: base() | ||
{ | ||
} | ||
|
||
public DomainException(string message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
public DomainException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
} | ||
|
||
public static void ThrowIf(bool condition) | ||
{ | ||
if (condition) | ||
throw new DomainException(); | ||
} | ||
|
||
public static void ThrowIf(bool condition, string message) | ||
{ | ||
if (condition) | ||
throw new DomainException(message); | ||
} | ||
|
||
public static void ThrowIfEmpty(string value, [CallerArgumentExpression(nameof(value))] string? paramName = null) | ||
{ | ||
if (value.IsEmpty()) | ||
throw new DomainException($"{paramName} cannot be empty"); | ||
} | ||
|
||
public static void ThrowIfNegative(decimal value, [CallerArgumentExpression(nameof(value))] string? paramName = null) | ||
{ | ||
if (value <= 0) | ||
throw new DomainException($"{paramName} cannot be negative"); | ||
} | ||
|
||
public static void ThrowIfNull<T>(T value, [CallerArgumentExpression(nameof(value))] string? paramName = null) where T : class | ||
{ | ||
if (value is null) | ||
throw new DomainException($"{paramName} cannot be null"); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.