From f89f308c525e9deebc6d2cf6416e27dfe1a299dc Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 19 May 2019 16:03:38 +0200 Subject: Cleanup DiscoBot Project --- DSACore/Auxiliary/Calculator/Argument.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'DSACore/Auxiliary/Calculator/Argument.cs') diff --git a/DSACore/Auxiliary/Calculator/Argument.cs b/DSACore/Auxiliary/Calculator/Argument.cs index 52f33a9..14982aa 100644 --- a/DSACore/Auxiliary/Calculator/Argument.cs +++ b/DSACore/Auxiliary/Calculator/Argument.cs @@ -1,7 +1,7 @@ namespace DSACore.Auxiliary.Calculator { using System; - + /// /// Provides an ISolvable class to save numbers. The class handles Argument checking and conversion from string to int. /// @@ -12,27 +12,24 @@ 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 (string.IsNullOrEmpty(value)) + throw new ArgumentException("Argument kann nicht mit einem leeren string instanziert werden. ", + nameof(value)); - if (!int.TryParse(value, out int result)) - { + if (!int.TryParse(value, out var result)) throw new ArgumentException($"Kann {value} nicht in Integer konvertieren"); - } this.value = result; } public int Solve() { - return this.value; + return value; } public override string ToString() { - return this.value.ToString(); + return value.ToString(); } } } \ No newline at end of file -- cgit v1.2.3-70-g09d2