summaryrefslogtreecommitdiff
path: root/DesignPatterns/src/app/DesignPatterns.Factory/Exceptions
diff options
context:
space:
mode:
Diffstat (limited to 'DesignPatterns/src/app/DesignPatterns.Factory/Exceptions')
-rw-r--r--DesignPatterns/src/app/DesignPatterns.Factory/Exceptions/CannotAddMoniesException.cs13
-rw-r--r--DesignPatterns/src/app/DesignPatterns.Factory/Exceptions/NegativeMoneyException.cs15
2 files changed, 28 insertions, 0 deletions
diff --git a/DesignPatterns/src/app/DesignPatterns.Factory/Exceptions/CannotAddMoniesException.cs b/DesignPatterns/src/app/DesignPatterns.Factory/Exceptions/CannotAddMoniesException.cs
new file mode 100644
index 0000000..421883c
--- /dev/null
+++ b/DesignPatterns/src/app/DesignPatterns.Factory/Exceptions/CannotAddMoniesException.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Runtime.Serialization;
+
+namespace DesignPatterns.Factory {
+ [Serializable]
+ public class CannotAddMoniesException : ArgumentException
+ {
+ public CannotAddMoniesException() { }
+ public CannotAddMoniesException(string message) : base(message) { }
+ public CannotAddMoniesException(string message, Exception innerException) : base(message, innerException) { }
+ protected CannotAddMoniesException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+} \ No newline at end of file
diff --git a/DesignPatterns/src/app/DesignPatterns.Factory/Exceptions/NegativeMoneyException.cs b/DesignPatterns/src/app/DesignPatterns.Factory/Exceptions/NegativeMoneyException.cs
new file mode 100644
index 0000000..d7d313d
--- /dev/null
+++ b/DesignPatterns/src/app/DesignPatterns.Factory/Exceptions/NegativeMoneyException.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Runtime.Serialization;
+
+namespace DesignPatterns.Factory {
+ [Serializable]
+ public class NegativeMoneyException : ArgumentException {
+ public NegativeMoneyException( ) : this( "Cannot create a negative money." ) {}
+
+ public NegativeMoneyException( string message ) : base( message ) {}
+
+ public NegativeMoneyException( string message, Exception innerException ) : base( message, innerException ) {}
+
+ protected NegativeMoneyException( SerializationInfo info, StreamingContext context ) : base( info, context ) {}
+ }
+} \ No newline at end of file