Private
Public Access
Written test for current and future commands
This commit is contained in:
1 parent
364cf63c17
commit
794ab33c48
1 file changed
+197
-7
+197
-7
@@ -13,11 +13,20 @@ namespace Advanced_Software_Engineering_Tests {
|
|||||||
public void VerbFactoryTester_Automatic1() {
|
public void VerbFactoryTester_Automatic1() {
|
||||||
Dictionary<string, int[]> commandParamaterNumber = new Dictionary<string, int[]>
|
Dictionary<string, int[]> commandParamaterNumber = new Dictionary<string, int[]>
|
||||||
{
|
{
|
||||||
{"moveto", new int[] { 2 } },
|
{"moveto", new int[] { 2 } },
|
||||||
{"drawto", new int[] { 2 } },
|
{"drawto", new int[] { 2 } },
|
||||||
{"line", new int[] { 2 } },
|
{"line", new int[] { 2 } },
|
||||||
{"lineto", new int[] { 2 } },
|
{"lineto", new int[] { 2 } },
|
||||||
{"shape", new int[] { 2, 3 } }
|
{"shape", new int[] { 2, 3 } },
|
||||||
|
|
||||||
|
{"square", new int[] { 1, 2 } },
|
||||||
|
{"rectangle", new int[] { 2, 3 } },
|
||||||
|
{"circle", new int[] { 1 } },
|
||||||
|
{"triangle", new int[] { 1, 2 } },
|
||||||
|
{"dot", new int[] { 0 } },
|
||||||
|
{"clear", new int[] { 0 } },
|
||||||
|
{"pen", new int[] {1, 3 } },
|
||||||
|
{"fill", new int[] {1, 3 } }
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (string command in commandParamaterNumber.Keys) {
|
foreach (string command in commandParamaterNumber.Keys) {
|
||||||
@@ -45,9 +54,9 @@ namespace Advanced_Software_Engineering_Tests {
|
|||||||
string verbDesc = verb.GetDescription();
|
string verbDesc = verb.GetDescription();
|
||||||
string correctDesc;
|
string correctDesc;
|
||||||
if (commandParameterNumbers == 2)
|
if (commandParameterNumbers == 2)
|
||||||
correctDesc = "Draws a " + inputParameters[0] + " sided regular polygon, with rotation of 0 radians, with inner radius of " + (double) inputParameters[1];
|
correctDesc = "Draws a " + inputParameters[0] + " sided regular polygon, with rotation of 0 radians, with inner radius of " + (double)inputParameters[1];
|
||||||
else
|
else
|
||||||
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];
|
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);
|
Assert.AreEqual(correctDesc, verbDesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,5 +66,186 @@ namespace Advanced_Software_Engineering_Tests {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void MoveToTester_Manual1() {
|
||||||
|
string input = "move 200, 300";
|
||||||
|
string[] inputParameters = { "200", "300" };
|
||||||
|
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Move origin to " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
Assert.AreEqual(correctDesc, verbDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void MoveToTester_Manual2() {
|
||||||
|
string input = "moveto 200, 300";
|
||||||
|
string[] inputParameters = { "200", "300" };
|
||||||
|
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Move origin to " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
Assert.AreEqual(correctDesc, verbDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void DrawToTester_Manual1() {
|
||||||
|
string input = "drawto 200, 300";
|
||||||
|
string[] inputParameters = { "200", "300" };
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Draw line " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
Assert.AreEqual(correctDesc, verbDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void DrawToTester_Manual2() {
|
||||||
|
string input = "line 200, 300";
|
||||||
|
string[] inputParameters = { "200", "300" };
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Draw line " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
Assert.AreEqual(correctDesc, verbDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void DrawToTester_Manual3() {
|
||||||
|
string input = "lineto 200, 300";
|
||||||
|
string[] inputParameters = { "200", "300" };
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Draw line " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
Assert.AreEqual(correctDesc, verbDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void RegularPolygonTester_Manual1() {
|
||||||
|
string input = "regularpolygon 3, 50";
|
||||||
|
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
|
||||||
|
int sides = 3;
|
||||||
|
double scale = 50;
|
||||||
|
double offset = 0;
|
||||||
|
string correctDesc = "Draws a " + sides + " sided regular polygon, with rotation of " + offset + " radians, with inner radius of " + scale;
|
||||||
|
|
||||||
|
Assert.AreEqual(correctDesc, verbDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void RegularPolygonTester_Manual2() {
|
||||||
|
string input = "rp 3, 50";
|
||||||
|
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
|
||||||
|
int sides = 3;
|
||||||
|
double scale = 50;
|
||||||
|
double offset = 0;
|
||||||
|
string correctDesc = "Draws a " + sides + " sided regular polygon, with rotation of " + offset + " radians, with inner radius of " + scale;
|
||||||
|
|
||||||
|
Assert.AreEqual(correctDesc, verbDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void RegularPolygonTester_Manual3() {
|
||||||
|
string input = "regularpolygon 3, 50, 25";
|
||||||
|
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
|
||||||
|
int sides = 3;
|
||||||
|
double scale = 50;
|
||||||
|
double offset = 25 * Math.PI / 180;
|
||||||
|
string correctDesc = "Draws a " + sides + " sided regular polygon, with rotation of " + offset + " radians, with inner radius of " + scale;
|
||||||
|
|
||||||
|
Assert.AreEqual(correctDesc, verbDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void RegularPolygonTester_Manual4() {
|
||||||
|
string input = "rp 3, 50, 25";
|
||||||
|
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
|
||||||
|
int sides = 3;
|
||||||
|
double scale = 50;
|
||||||
|
double offset = 25 * Math.PI / 180;
|
||||||
|
string correctDesc = "Draws a " + sides + " sided regular polygon, with rotation of " + offset + " radians, with inner radius of " + scale;
|
||||||
|
|
||||||
|
Assert.AreEqual(correctDesc, verbDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void DotTester_Manual1() {
|
||||||
|
string input = "";
|
||||||
|
string[] inputParameters = { };
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Move origin to " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void ClearTester_Manual1() {
|
||||||
|
string input = "";
|
||||||
|
string[] inputParameters = { };
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Move origin to " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void PenTester_Manual1() {
|
||||||
|
string input = "";
|
||||||
|
string[] inputParameters = { };
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Move origin to " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void FillTester_Manual1() {
|
||||||
|
string input = "";
|
||||||
|
string[] inputParameters = { };
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Move origin to " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void IfTester_Manual1() {
|
||||||
|
string input = "";
|
||||||
|
string[] inputParameters = { };
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Move origin to " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void MethodTester_Manual1() {
|
||||||
|
string input = "";
|
||||||
|
string[] inputParameters = { };
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Move origin to " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void ValueTester_Manual1() {
|
||||||
|
string input = "";
|
||||||
|
string[] inputParameters = { };
|
||||||
|
Verb verb = VerbFactory.MakeVerb(null, input);
|
||||||
|
string verbDesc = verb.GetDescription();
|
||||||
|
string correctDesc = "Move origin to " + inputParameters[0] + ", " + inputParameters[1];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user