diff options
Diffstat (limited to 'src/app/Cmpp298.Assignment3.Domain/AmountEntrySpecification.cs')
| -rw-r--r-- | src/app/Cmpp298.Assignment3.Domain/AmountEntrySpecification.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/app/Cmpp298.Assignment3.Domain/AmountEntrySpecification.cs b/src/app/Cmpp298.Assignment3.Domain/AmountEntrySpecification.cs new file mode 100644 index 0000000..d7bfe18 --- /dev/null +++ b/src/app/Cmpp298.Assignment3.Domain/AmountEntrySpecification.cs @@ -0,0 +1,9 @@ +using System.Text.RegularExpressions;
+
+namespace Cmpp298.Assignment3.Domain {
+ public class AmountEntrySpecification : ISpecification< string > {
+ public bool IsSatisfiedBy( string input ) {
+ return Regex.IsMatch( input, @"(^\d*\.?\d*[0-9]+\d*$)|(^[0-9]+\d*\.\d*$)" );
+ }
+ }
+}
\ No newline at end of file |
