diff options
author | Dennis Kobert <d-kobert@web.de> | 2019-06-11 23:38:13 +0200 |
---|---|---|
committer | Dennis Kobert <d-kobert@web.de> | 2019-06-11 23:38:13 +0200 |
commit | 2fa4a0e50ebfc97059c8b84dbd17e79f9afc8a8d (patch) | |
tree | c3b34ccb2737e347a73768536895cbbaab13cc01 /DSACore/Auxiliary/Calculator/Argument.cs | |
parent | ec991104f56e90d7bb2878da2fe6ed4e585dfc46 (diff) | |
parent | af74efccf8d21e6151022b71f3cacd3fa83024ee (diff) |
Merge branch 'rework-backend'
Diffstat (limited to 'DSACore/Auxiliary/Calculator/Argument.cs')
-rw-r--r-- | DSACore/Auxiliary/Calculator/Argument.cs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/DSACore/Auxiliary/Calculator/Argument.cs b/DSACore/Auxiliary/Calculator/Argument.cs deleted file mode 100644 index 52f33a9..0000000 --- a/DSACore/Auxiliary/Calculator/Argument.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace DSACore.Auxiliary.Calculator -{ - using System; - - /// <summary> - /// Provides an ISolvable class to save numbers. The class handles Argument checking and conversion from string to int. - /// </summary> - public class Argument : ISolvable - { - private readonly int value; - - public Argument(string value) - { - // check whether the value given is an empty string - if (string.IsNullOrEmpty(value)) - { - throw new ArgumentException("Argument kann nicht mit einem leeren string instanziert werden. ", nameof(value)); - } - - if (!int.TryParse(value, out int result)) - { - throw new ArgumentException($"Kann {value} nicht in Integer konvertieren"); - } - - this.value = result; - } - - public int Solve() - { - return this.value; - } - - public override string ToString() - { - return this.value.ToString(); - } - } -}
\ No newline at end of file |