Fixed some test

This commit is contained in:
Lukasz Baldyga committed 2020-10-25 10:37:48 +00:00
1 parent 0d8fa71602
commit 69dcf40da2
4 files changed
+8 -9

No files matched your search

@@ -3,6 +3,7 @@ using Advanced_Software_Engineering;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Advanced_Software_Engineering.Verbs;
namespace Advanced_Software_Engineering_Tests { namespace Advanced_Software_Engineering_Tests {
[TestClass] [TestClass]
@@ -52,7 +53,7 @@ namespace Advanced_Software_Engineering_Tests {
int expected = rand.Next(int.MinValue, int.MaxValue); int expected = rand.Next(int.MinValue, int.MaxValue);
string input = expected.ToString(); string input = expected.ToString();
Assert.AreEqual(expected, SettingsAndHelperFunctions.ConvertToInt(input)); Assert.AreEqual(expected, Value.ConvertToInt(input));
} }
} }
@@ -62,7 +63,7 @@ namespace Advanced_Software_Engineering_Tests {
double expected = rand.NextDouble(); double expected = rand.NextDouble();
string input = expected.ToString(); string input = expected.ToString();
Assert.AreEqual(expected, SettingsAndHelperFunctions.ConvertToDouble(input)); Assert.AreEqual(expected, Value.ConvertToDouble(input));
} }
} }
@@ -72,7 +73,7 @@ namespace Advanced_Software_Engineering_Tests {
double expected = rand.Next(100, 100) * rand.NextDouble(); double expected = rand.Next(100, 100) * rand.NextDouble();
string input = expected.ToString(); string input = expected.ToString();
Assert.AreEqual(expected, SettingsAndHelperFunctions.ConvertToDouble(input)); Assert.AreEqual(expected, Value.ConvertToDouble(input));
} }
} }
@@ -82,7 +83,7 @@ namespace Advanced_Software_Engineering_Tests {
int expected = rand.Next(100, 100); int expected = rand.Next(100, 100);
string input = ((double)expected).ToString(); string input = ((double)expected).ToString();
Assert.AreEqual((double)expected, SettingsAndHelperFunctions.ConvertToDouble(input)); Assert.AreEqual((double)expected, Value.ConvertToDouble(input));
} }
} }
@@ -9,9 +9,6 @@ namespace Advanced_Software_Engineering.Verbs.DrawingVerbs {
class Quadrilateral : Verb { class Quadrilateral : Verb {
Verb verb; Verb verb;
bool descCreated = false;
string desc;
public Quadrilateral(Drawer drawer, Point point1, Point point2, Point point3, Point point4) { public Quadrilateral(Drawer drawer, Point point1, Point point2, Point point3, Point point4) {
verb = new DrawLines(drawer, new Point[] { point1, point2, point3, point4 }); verb = new DrawLines(drawer, new Point[] { point1, point2, point3, point4 });
} }
@@ -5,8 +5,8 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Advanced_Software_Engineering { namespace Advanced_Software_Engineering.Verbs {
class Value { public class Value {
public static int ConvertToInt(string text) { public static int ConvertToInt(string text) {
text = SettingsAndHelperFunctions.Strip(text); text = SettingsAndHelperFunctions.Strip(text);
return int.Parse(text); return int.Parse(text);
@@ -6,6 +6,7 @@ using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.VisualStyles; using System.Windows.Forms.VisualStyles;
using Advanced_Software_Engineering.Verbs;
using Advanced_Software_Engineering.Verbs.DrawingVerbs; using Advanced_Software_Engineering.Verbs.DrawingVerbs;
namespace Advanced_Software_Engineering { namespace Advanced_Software_Engineering {