diff --git a/Advanced Software Engineering/Advanced Software Engineering Tests/Advanced Software Engineering Tests.xml b/Advanced Software Engineering/Advanced Software Engineering Tests/Advanced Software Engineering Tests.xml index a9632f5..4713d6c 100644 --- a/Advanced Software Engineering/Advanced Software Engineering Tests/Advanced Software Engineering Tests.xml +++ b/Advanced Software Engineering/Advanced Software Engineering Tests/Advanced Software Engineering Tests.xml @@ -6,13 +6,13 @@ - The CommandTester class tests the commands possible, mostly by getting a verb and checking it's description.. + The CommandTester class tests the commands possible, mostly by getting a verb and checking it's description.. Automatically tests: - - moveto + - moveto - drawto - line - rp @@ -23,113 +23,113 @@ - triangle - dot - clear - - pen + - pen - fill - tests the "move" command. See . + tests the "move" command. See . - tests the "moveto" command. See . + tests the "moveto" command. See . - tests the "drawto" command. See . + tests the "drawto" command. See . - tests the "line" command. See . + tests the "line" command. See . - tests the "lineto" command. See . + tests the "lineto" command. See . - tests the "regularpolygon" command. See . + tests the "regularpolygon" command. See . - tests the "rp" command. See . + tests the "rp" command. See . - tests the "regularpolygon" command. See . + tests the "regularpolygon" command. See . - tests the "rp" command. See . + tests the "rp" command. See . - tests the "square" command. See . + tests the "square" command. See . - tests the "square" command. See . + tests the "square" command. See . - tests the "quadrilateral" command using . See . + tests the "quadrilateral" command using . See . - Tests the "circle" command. See . + Tests the "circle" command. See . - tests the "triangle" command. See . + tests the "triangle" command. See . - tests the "triangle" command. See . + tests the "triangle" command. See . - test the "dot" command. See . + test the "dot" command. See . - tests the "clear" command. See . + tests the "clear" command. See . - Tests the "reset" command. See + Tests the "reset" command. See - Tests the "resetpen" command. See . + Tests the "resetpen" command. See . - Tests the command "pen". See + Tests the command "pen". See - Tests the command "fill". See . + Tests the command "fill". See . @@ -165,7 +165,7 @@ - This class tests methods and some methods. It uses a combination of manual and random tests. + This class tests methods and some methods. It uses a combination of manual and random tests. @@ -175,68 +175,68 @@ - Manual test + Manual test - Manual test + Manual test - Random test. + Random test. - Random test. + Random test. - Random test. + Random test. - Random test. + Random test. - Manual test. + Manual test. - Manual test. + Manual test. - Manual test. + Manual test. - Manual test. + Manual test. - Manual test. + Manual test. - Manual test. + Manual test. - Random test. + Random test. - + \ No newline at end of file diff --git a/Advanced Software Engineering/Advanced Software Engineering Tests/CommandTester.cs b/Advanced Software Engineering/Advanced Software Engineering Tests/CommandTester.cs index ae98c1d..b05f6b8 100644 --- a/Advanced Software Engineering/Advanced Software Engineering Tests/CommandTester.cs +++ b/Advanced Software Engineering/Advanced Software Engineering Tests/CommandTester.cs @@ -1,22 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Text; -using Advanced_Software_Engineering; +using Advanced_Software_Engineering; using Advanced_Software_Engineering.Verbs.DrawingVerbs; using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Drawing; namespace Advanced_Software_Engineering_Tests { + /// - /// The CommandTester class tests the commands possible, mostly by getting a verb and checking it's description.. + /// The CommandTester class tests the commands possible, mostly by getting a verb and checking it's description.. /// [TestClass] public class CommandTester { - Random rand = new Random(); + private Random rand = new Random(); /// /// Automatically tests: - /// - moveto + /// - moveto /// - drawto /// - line /// - rp @@ -27,7 +27,7 @@ namespace Advanced_Software_Engineering_Tests { /// - triangle /// - dot /// - clear - /// - pen + /// - pen /// - fill /// [TestMethod] @@ -80,11 +80,8 @@ namespace Advanced_Software_Engineering_Tests { correctDesc = "Draws a " + inputParameters[0] + " sided regular polygon, with rotation of " + (double)(Math.PI * inputParameters[2] / 180) + " radians, with inner radius of " + (double)inputParameters[1]; Assert.AreEqual(correctDesc, verbDesc); } - } - } - } /// @@ -406,7 +403,7 @@ namespace Advanced_Software_Engineering_Tests { string input = "pen red"; Verb verb = VerbFactory.MakeVerb(null, input); string verbDesc = verb.GetDescription(); - string correctDesc = "Set pen color to: Color [Red]"; + string correctDesc = "Set pen color to: Color [Red]"; Assert.AreEqual(correctDesc, verbDesc); } @@ -419,7 +416,7 @@ namespace Advanced_Software_Engineering_Tests { string input = "fill pink"; Verb verb = VerbFactory.MakeVerb(null, input); string verbDesc = verb.GetDescription(); - string correctDesc = "Set fill color to: Color [Pink]"; + string correctDesc = "Set fill color to: Color [Pink]"; Assert.AreEqual(correctDesc, verbDesc); } @@ -430,10 +427,10 @@ namespace Advanced_Software_Engineering_Tests { [TestMethod] public void IfTester_Manual1() { string input = "if i == 10"; - + Verb verb = VerbFactory.MakeVerb(null, input); string verbDesc = verb.GetDescription(); - string correctDesc = "Tests if variable 'i' is equal to 10"; + string correctDesc = "Tests if variable 'i' is equal to 10"; Assert.AreEqual(correctDesc, verbDesc); } @@ -444,7 +441,7 @@ namespace Advanced_Software_Engineering_Tests { [TestMethod] public void MethodTester_Manual1() { string input = "def duck, int i"; - + Verb verb = VerbFactory.MakeVerb(null, input); string verbDesc = verb.GetDescription(); string correctDesc = "Create a new method called 'duck' with input 'int i'. The method: "; @@ -461,10 +458,9 @@ namespace Advanced_Software_Engineering_Tests { Verb verb = VerbFactory.MakeVerb(null, input); string verbDesc = verb.GetDescription(); - string correctDesc = "Declares and sets integer 'i' to '10'"; + string correctDesc = "Declares and sets integer 'i' to '10'"; Assert.AreEqual(correctDesc, verbDesc); } - } -} +} \ No newline at end of file diff --git a/Advanced Software Engineering/Advanced Software Engineering Tests/SettingsAndHelperFunctionsTester.cs b/Advanced Software Engineering/Advanced Software Engineering Tests/SettingsAndHelperFunctionsTester.cs index 7656969..d0abecb 100644 --- a/Advanced Software Engineering/Advanced Software Engineering Tests/SettingsAndHelperFunctionsTester.cs +++ b/Advanced Software Engineering/Advanced Software Engineering Tests/SettingsAndHelperFunctionsTester.cs @@ -1,25 +1,25 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; using Advanced_Software_Engineering; +using Advanced_Software_Engineering.Verbs; +using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; using System.Linq; -using Advanced_Software_Engineering.Verbs; namespace Advanced_Software_Engineering_Tests { + /// /// This class tests methods and some methods. It uses a combination of manual and random tests. /// [TestClass] public class SettingsAndHelperFunctionsTester { - string alphabet = "abcdefghijklmnopqrstuvwxzy"; - Random rand = new Random(); + private string alphabet = "abcdefghijklmnopqrstuvwxzy"; + private Random rand = new Random(); /// /// Random strip spaces test /// [TestMethod] public void Strip_Random1() { - for (int test = 0; test < 200; test++) { int until = rand.Next(50); string correctOutput = ""; @@ -33,7 +33,6 @@ namespace Advanced_Software_Engineering_Tests { obfuscatedInput = randomSpaces() + obfuscatedInput + randomSpaces(); Assert.AreEqual(correctOutput, SettingsAndHelperFunctions.Strip(obfuscatedInput)); - } } @@ -183,7 +182,7 @@ namespace Advanced_Software_Engineering_Tests { Assert.AreEqual("4 5", commands["parameters"][2]); } - string randomSpaces() { + private string randomSpaces() { string spaces = " "; for (int i = 0; i < 50; i++) spaces += " "; return spaces; @@ -194,7 +193,6 @@ namespace Advanced_Software_Engineering_Tests { /// [TestMethod] public void CommandAndParameterParser_Random1() { - string[] randomCommands = { "test", "moveto", "lineto", "markiplier", "clear", "shape", "etc" }; for (int test = 0; test < 10000; test++) { @@ -216,9 +214,7 @@ namespace Advanced_Software_Engineering_Tests { foreach (string expected in parameters) { Assert.AreEqual(expected, commands["parameters"][i++]); } - } - } } -} +} \ No newline at end of file