summaryrefslogtreecommitdiff
path: root/DiscoBot/Auxiliary/Calculator/Argument.cs
diff options
context:
space:
mode:
authorDennis Kobert <d-kobert@web.de>2019-05-19 16:03:38 +0200
committerDennis Kobert <d-kobert@web.de>2019-05-19 16:03:38 +0200
commitf89f308c525e9deebc6d2cf6416e27dfe1a299dc (patch)
tree7097ef871ead0245efda696198443eab8e443d3a /DiscoBot/Auxiliary/Calculator/Argument.cs
parentf3983341be939235c1a6cd522b3bb5cc318a6d1a (diff)
Cleanup DiscoBot Project
Diffstat (limited to 'DiscoBot/Auxiliary/Calculator/Argument.cs')
-rw-r--r--DiscoBot/Auxiliary/Calculator/Argument.cs38
1 files changed, 0 insertions, 38 deletions
diff --git a/DiscoBot/Auxiliary/Calculator/Argument.cs b/DiscoBot/Auxiliary/Calculator/Argument.cs
deleted file mode 100644
index 2379bfe..0000000
--- a/DiscoBot/Auxiliary/Calculator/Argument.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-namespace DiscoBot.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