diff --git a/core/AutoCheck.Core.csproj b/core/AutoCheck.Core.csproj
index 57844f5d..60ffb8f7 100644
--- a/core/AutoCheck.Core.csproj
+++ b/core/AutoCheck.Core.csproj
@@ -6,7 +6,7 @@
Fernando Porrino Serrano
AutoCheck.Core
Copyright © 2022
- 2.17.0
+ 2.17.1
stable
$(VersionPrefix)
$(AssemblyVersion)
diff --git a/core/connectors/Csv.cs b/core/connectors/Csv.cs
index d77a89d6..031ef344 100644
--- a/core/connectors/Csv.cs
+++ b/core/connectors/Csv.cs
@@ -32,7 +32,7 @@ public class CsvDocument{
//TODO: use some library...
private char FielDelimiter {get; set;}
- private char TextDelimiter {get; set;}
+ private char? TextDelimiter {get; set;}
///
/// All the content, grouped by columns.
@@ -68,7 +68,7 @@ public int Count {
/// Field delimiter char.
/// Text delimiter char.
/// True if the first row are headers.
- public CsvDocument(string file, char fieldDelimiter=',', char textDelimiter='"', bool headers = true){
+ public CsvDocument(string file, char fieldDelimiter=',', char? textDelimiter='"', bool headers = true){
this.FielDelimiter = fieldDelimiter;
this.TextDelimiter = textDelimiter;
@@ -94,10 +94,12 @@ public CsvDocument(string file, char fieldDelimiter=',', char textDelimiter='"',
for(int i = 0; i < items.Length; i++){
string item = items[i];
- if(item.StartsWith(this.TextDelimiter) && item.EndsWith(this.TextDelimiter)){
- //Removing string delimiters
- item = item.Trim(TextDelimiter);
- }
+ if(this.TextDelimiter.HasValue){
+ if(item.StartsWith(this.TextDelimiter.Value) && item.EndsWith(this.TextDelimiter.Value)){
+ //Removing string delimiters
+ item = item.Trim(TextDelimiter.Value);
+ }
+ }
this.Content[this.Content.Keys.ElementAt(i)].Add(item);
}
@@ -175,7 +177,7 @@ public class Csv: Base{
/// Field delimiter char.
/// Text delimiter char.
/// True if the first row are headers.
- public Csv(string filePath, char fieldDelimiter=',', char textDelimiter='"', bool headers = true){
+ public Csv(string filePath, char fieldDelimiter=',', char? textDelimiter='"', bool headers = true){
Parse(filePath, fieldDelimiter, textDelimiter, headers);
}
@@ -211,7 +213,7 @@ public Csv(Utils.OS remoteOS, string host, string username, string password, int
public Csv(Utils.OS remoteOS, string host, string username, string password, string filePath, char fieldDelimiter=',', char textDelimiter='"', bool headers = true): this(remoteOS, host, username, password, 22, filePath, fieldDelimiter, textDelimiter, headers){
}
- private void Parse(string filePath, char fieldDelimiter=',', char textDelimiter='"', bool headers = true){
+ private void Parse(string filePath, char fieldDelimiter=',', char? textDelimiter='"', bool headers = true){
if(string.IsNullOrEmpty(filePath)) throw new ArgumentNullException("filePath");
if(!File.Exists(filePath)) throw new FileNotFoundException();
diff --git a/core/copy/PlainText.cs b/core/copy/PlainText.cs
index 1cbbb762..77caa82b 100644
--- a/core/copy/PlainText.cs
+++ b/core/copy/PlainText.cs
@@ -30,8 +30,10 @@ namespace AutoCheck.Core.CopyDetectors{
///
public class PlainText: Base{
protected class File{
- public string Folder {get; set;}
- public string Path {get; set;}
+ public string FolderPath {get; set;}
+ public string FolderName {get; set;}
+ public string FilePath {get; set;}
+ public string FileName {get; set;}
public int WordCount {get; set;}
public int LineCount {get; set;}
public List Content {get; set;}
@@ -41,8 +43,10 @@ public File(string folder, string file){
WordCount = Content.SelectMany(x => x.Split(" ")).Count();
LineCount = Content.Count();
- Folder = folder;
- Path = file;
+ FolderPath = folder;
+ FolderName = System.IO.Path.GetFileName(folder);
+ FilePath = file;
+ FileName = System.IO.Path.GetFileName(file);
}
public override string ToString(){
@@ -189,10 +193,10 @@ public override (string Folder, string File, (string Folder, string File, float
int i = Index[path];
var matches = new List<(string, string, float)>();
for(int j=0; j < Files.Count(); j++){
- if(i != j) matches.Add((Files[j].Folder, Files[j].Path, Matches[i,j]));
+ if(i != j) matches.Add((Files[j].FolderPath, Files[j].FilePath, Matches[i,j]));
}
- return (Files[i].Folder, Files[i].Path, matches.ToArray());
+ return (Files[i].FolderPath, Files[i].FilePath, matches.ToArray());
}
}
}
\ No newline at end of file
diff --git a/core/copy/SourceCode.cs b/core/copy/SourceCode.cs
index 9a68a4df..5f3bfcae 100644
--- a/core/copy/SourceCode.cs
+++ b/core/copy/SourceCode.cs
@@ -43,21 +43,21 @@ public override void Compare(){
//JPlag uses one single path
var path = GetMinimalPath(Files);
var shell = new Connectors.Shell();
- var output = Path.Combine(Utils.TempFolder, DateTime.Now.ToString("yyyyMMddhhhhMMssffff"));
+ var output = Path.Combine(Utils.TempFolder, $@"{Guid.NewGuid()}");
if(!Directory.Exists(output)) Directory.CreateDirectory(output);
try{
//Setting up execution
var lang = Path.GetExtension(FilePattern).TrimStart('.');
- var result = shell.RunCommand($"java -jar jplag-3.0.0-jar-with-dependencies.jar -r {output} -l {lang} {path}", Utils.UtilsFolder);
+ var result = shell.RunCommand($"java -jar jplag-3.0.0-jar-with-dependencies.jar -r \"{output}\" -l {lang} \"{path}\"", Utils.UtilsFolder);
//Parsing result (JPlag creates a CSV file with the output data)
- var csv = new Connectors.Csv(Path.Combine(output, "matches_avg.csv"), ';', ' ', false);
+ var csv = new Connectors.Csv(Path.Combine(output, "matches_avg.csv"), ';', null, false);
var folders = new Dictionary();
//temp directory to match the JPlag directory name with the original index (directory path)
foreach(var key in Index.Keys){
- folders.Add(Path.GetFileName(key).Replace(" ", ""), Index[key]);
+ folders.Add(Path.GetFileName(key).Trim(), Index[key]);
}
//collecting matches
@@ -110,9 +110,9 @@ public override bool CopyDetected(string path){
}
private string GetMinimalPath(List paths){
- var left = paths.FirstOrDefault().Folder;
+ var left = paths.FirstOrDefault().FolderPath;
foreach(var right in paths.Skip(1)){
- left = GetMinimalPath(left, right.Folder);
+ left = GetMinimalPath(left, right.FolderPath);
}
return left;
diff --git a/scripts/templates/mineseeker.yaml b/scripts/templates/mineseeker.yaml
index 0152b713..807937d8 100644
--- a/scripts/templates/mineseeker.yaml
+++ b/scripts/templates/mineseeker.yaml
@@ -17,7 +17,7 @@
# along with AutoCheck. If not, see .
name: "DAM - M03 (UF1): Mineseeker"
-version: "1.0.1.0"
+version: "1.0.1.2"
#TODO: sacar las preguntas de dentro de la primera y hacer un ABORT si no compila.
# arreglar fallo en codigo fuente al poner minas en casillas ocupadas
@@ -55,7 +55,7 @@ body:
- run:
caption: "Compiling the file ~{$FILENAME}... "
- command: "javac {$FILEPATH}"
+ command: javac "{$FILEPATH}"
expected: ""
onexception: "ABORT"
@@ -64,22 +64,22 @@ body:
content:
- run:
caption: "Checking the caption... "
- command: "echo 3 | java {$FILEPATH}"
+ command: echo 3 | java "{$FILEPATH}"
expected: "%Escull una opció:%"
- run:
caption: "Checking the first option... "
- command: "echo 3 | java {$FILEPATH}"
+ command: echo 3 | java "{$FILEPATH}"
expected: "%1. Emplenar el taulell%"
- run:
caption: "Checking the second option... "
- command: "echo 3 | java {$FILEPATH}"
+ command: echo 3 | java "{$FILEPATH}"
expected: "%2. Mostrar el taulell%"
- run:
caption: "Checking the third option... "
- command: "echo 3 | java {$FILEPATH}"
+ command: echo 3 | java "{$FILEPATH}"
expected: "%3. Sortir%"
- question:
@@ -87,32 +87,32 @@ body:
content:
- run:
caption: "Checking the input data giving no data... "
- command: "echo 1 | java {$FILEPATH}"
+ command: echo 1 | java "{$FILEPATH}"
expected: "Exception%"
- run:
caption: "Checking the input data giving rows... "
- command: "echo 1 5 | java {$FILEPATH}"
+ command: echo 1 5 | java "{$FILEPATH}"
expected: "Exception%"
- run:
caption: "Checking the input data giving rows and columns... "
- command: "echo 1 5 4 | java {$FILEPATH}"
+ command: echo 1 5 4 | java "{$FILEPATH}"
expected: "Exception%"
- run:
caption: "Checking the input question for the rows... "
- command: "echo 1 5 4 1 3 | java {$FILEPATH}"
+ command: echo 1 5 4 1 3 | java "{$FILEPATH}"
expected: "%De quantes files vols el taulell?%"
- run:
caption: "Checking the input question for the columns... "
- command: "echo 1 5 4 1 3 | java {$FILEPATH}"
+ command: echo 1 5 4 1 3 | java "{$FILEPATH}"
expected: "%De quantes columnes vols el taulell?%"
- run:
caption: "Checking the input question for the mines... "
- command: "echo 1 5 4 1 3 | java {$FILEPATH}"
+ command: echo 1 5 4 1 3 | java "{$FILEPATH}"
expected: "%Quantes mines vols al taulell?%"
- question:
description: "Data verification"
@@ -120,12 +120,12 @@ body:
content:
- run:
caption: "Checking that more mines that cells is not allowed... "
- command: "echo 1 1 1 2 3 | java {$FILEPATH}"
+ command: echo 1 1 1 2 3 | java "{$FILEPATH}"
expected: "%NO ES PODEN POSAR MÉS MINES QUE CASELLES%"
- connector:
type: "PlainText"
- arguments: "--filePath {$FILEPATH}"
+ arguments: --filePath "{$FILEPATH}"
- question:
description: "Board internal creation"
@@ -171,14 +171,14 @@ body:
content:
- run:
caption: "Checking the return to the main menu... "
- command: "echo 1 5 4 1 3 | java {$FILEPATH}"
+ command: echo 1 5 4 1 3 | java "{$FILEPATH}"
expected: "%Escull una opció:%"
- question:
description: "Displaying board's empty cells"
content:
- run:
- command: "echo 1 1 1 0 2 3 | java {$FILEPATH}"
+ command: echo 1 1 1 0 2 3 | java "{$FILEPATH}"
- run:
caption: "Checking the display for a 1x1 board with no mines... "
@@ -188,7 +188,7 @@ body:
expected: "1"
- run:
- command: "echo 1 5 3 0 2 3 | java {$FILEPATH}"
+ command: echo 1 5 3 0 2 3 | java "{$FILEPATH}"
- run:
caption: "Checking the display for a 5x3 board with no mines... "
@@ -198,7 +198,7 @@ body:
expected: "1"
- run:
- command: "echo 1 3 5 0 2 3 | java {$FILEPATH}"
+ command: echo 1 3 5 0 2 3 | java "{$FILEPATH}"
- run:
caption: "Checking the display for a 3x5 board with no mines... "
@@ -208,7 +208,7 @@ body:
expected: "1"
- run:
- command: "echo 1 5 5 0 2 3 | java {$FILEPATH}"
+ command: echo 1 5 5 0 2 3 | java "{$FILEPATH}"
- run:
caption: "Checking the display for a 5x5 board with no mines... "
@@ -221,7 +221,7 @@ body:
description: "Displaying board's mine cells"
content:
- run:
- command: "echo 1 1 1 1 2 3 | java {$FILEPATH}"
+ command: echo 1 1 1 1 2 3 | java "{$FILEPATH}"
- run:
caption: "Checking the display for a 1x1 board full of mines... "
@@ -231,7 +231,7 @@ body:
expected: "1"
- run:
- command: "echo 1 5 3 15 2 3 | java {$FILEPATH}"
+ command: echo 1 5 3 15 2 3 | java "{$FILEPATH}"
- run:
caption: "Checking the display for a 5x3 board full of mines... "
@@ -241,7 +241,7 @@ body:
expected: "1"
- run:
- command: "echo 1 3 5 15 2 3 | java {$FILEPATH}"
+ command: echo 1 3 5 15 2 3 | java "{$FILEPATH}"
- run:
caption: "Checking the display for a 3x5 board full of mines... "
@@ -251,13 +251,13 @@ body:
expected: "1"
- run:
- command: "echo 1 5 5 25 2 3 | java {$FILEPATH}"
+ command: echo 1 10 10 100 2 3 | java "{$FILEPATH}"
- run:
- caption: "Checking the display for a 5x5 board full of mines... "
+ caption: "Checking the display for a 10x10 board full of mines... "
connector: "TextStream"
command: "Count"
- arguments: --content {$RESULT} --regex "((?:\[O\]\s?){4}\[O\]\s*(?:\n|\\n)){5}"
+ arguments: --content {$RESULT} --regex "((?:\[O\]\s?){9}\[O\]\s*(?:\n|\\n)){10}"
expected: "1"
- question:
@@ -265,7 +265,7 @@ body:
content:
- run:
caption: "Checking the empty message... "
- command: "echo 2 3 | java {$FILEPATH}"
+ command: echo 2 3 | java "{$FILEPATH}"
expected: "%HA CREAT CAP TAULELL%" #' (written) and ’ (copied from the statement) must be accepted "%NO S’HA CREAT CAP TAULELL%"
- question:
@@ -274,5 +274,5 @@ body:
content:
- run:
caption: "Checking the menu display... "
- command: "echo 2 3 | java {$FILEPATH}"
+ command: echo 2 3 | java "{$FILEPATH}"
expected: "%Escull una opció:%"
diff --git a/test/main/Script.cs/Real/RealMineseeker.cs b/test/main/Script.cs/Real/RealMineseeker.cs
index 3d5ce444..6ef57ab1 100644
--- a/test/main/Script.cs/Real/RealMineseeker.cs
+++ b/test/main/Script.cs/Real/RealMineseeker.cs
@@ -30,42 +30,42 @@ public RealMineseeker(): base("script/real"){
}
[Test, Category("Mineseeker"), Category("Real"), Category("Local")]
- [TestCase(1)]
- [TestCase(2)]
- [TestCase(3)]
- [TestCase(4)]
- [TestCase(5)]
- [TestCase(7)]
- [TestCase(8)]
- [TestCase(9)]
- public void Real_Mineseeker_SCRIPT_SINGLE_PERFECT(int test)
+ [TestCase(1, "Student_Name_")]
+ [TestCase(2, "Student_Name_")]
+ [TestCase(3, "Student_Name_")]
+ [TestCase(4, "Student_Name_")]
+ [TestCase(5, "Student_Name_")]
+ [TestCase(7, "Student_Name_")]
+ [TestCase(8, "Student_Name_")]
+ [TestCase(9, "Student Name ")]
+ public void Real_Mineseeker_SCRIPT_SINGLE_PERFECT(int test, string folder)
{
var s = new AutoCheck.Core.Script(GetSampleFile($"real_mineseeker_single_{test}.yaml"));
- Assert.AreEqual($"Running script 'DAM - M03 (UF1): Mineseeker' (v1.0.1.0):\r\nRunning on single mode for 'Student_Name_{test}':\r\n Question 1 [0.5 points] - Checking main java file:\r\n Looking for .java... OK\r\n Loading the file Main.java... OK\r\n Compiling the file Main.java... OK\r\n\r\n Question 2 [1 point] - Main menu:\r\n Checking the caption... OK\r\n Checking the first option... OK\r\n Checking the second option... OK\r\n Checking the third option... OK\r\n\r\n Question 3 [1 point] - Input data:\r\n Checking the input data giving no data... OK\r\n Checking the input data giving rows... OK\r\n Checking the input data giving rows and columns... OK\r\n Checking the input question for the rows... OK\r\n Checking the input question for the columns... OK\r\n Checking the input question for the mines... OK\r\n\r\n Question 4 [0.5 points] - Data verification:\r\n Checking that more mines that cells is not allowed... OK\r\n\r\n Question 5 [1 point] - Board internal creation:\r\n Checking the internal board creation... OK\r\n Checking the internal board sizing... OK\r\n\r\n Question 6 [1 point] - Board mines filling:\r\n Checking the mine cell filling... OK\r\n\r\n Question 7 [1 point] - Random mines positioning:\r\n Checking that random location is being used... OK\r\n\r\n Question 8 [0.5 points] - Return to the menu after filling the board:\r\n Checking the return to the main menu... OK\r\n\r\n Question 9 [1 point] - Displaying board's empty cells:\r\n Checking the display for a 1x1 board with no mines... OK\r\n Checking the display for a 5x3 board with no mines... OK\r\n Checking the display for a 3x5 board with no mines... OK\r\n Checking the display for a 5x5 board with no mines... OK\r\n\r\n Question 10 [1 point] - Displaying board's mine cells:\r\n Checking the display for a 1x1 board full of mines... OK\r\n Checking the display for a 5x3 board full of mines... OK\r\n Checking the display for a 3x5 board full of mines... OK\r\n Checking the display for a 5x5 board full of mines... OK\r\n\r\n Question 11 [1 point] - Displaying empty board message:\r\n Checking the empty message... OK\r\n\r\n Question 12 [0.5 points] - Return to the menu after displaying the board:\r\n Checking the empty message... OK\r\n Checking the menu display... OK\r\n\r\n TOTAL SCORE: 10 / 10", s.Output.ToString());
+ Assert.AreEqual($"Running script 'DAM - M03 (UF1): Mineseeker' (v1.0.1.2):\r\nRunning on single mode for '{folder}{test}':\r\n Question 1 [0.5 points] - Checking main java file:\r\n Looking for .java... OK\r\n Loading the file Main.java... OK\r\n Compiling the file Main.java... OK\r\n\r\n Question 2 [1 point] - Main menu:\r\n Checking the caption... OK\r\n Checking the first option... OK\r\n Checking the second option... OK\r\n Checking the third option... OK\r\n\r\n Question 3 [1 point] - Input data:\r\n Checking the input data giving no data... OK\r\n Checking the input data giving rows... OK\r\n Checking the input data giving rows and columns... OK\r\n Checking the input question for the rows... OK\r\n Checking the input question for the columns... OK\r\n Checking the input question for the mines... OK\r\n\r\n Question 4 [0.5 points] - Data verification:\r\n Checking that more mines that cells is not allowed... OK\r\n\r\n Question 5 [1 point] - Board internal creation:\r\n Checking the internal board creation... OK\r\n Checking the internal board sizing... OK\r\n\r\n Question 6 [1 point] - Board mines filling:\r\n Checking the mine cell filling... OK\r\n\r\n Question 7 [1 point] - Random mines positioning:\r\n Checking that random location is being used... OK\r\n\r\n Question 8 [0.5 points] - Return to the menu after filling the board:\r\n Checking the return to the main menu... OK\r\n\r\n Question 9 [1 point] - Displaying board's empty cells:\r\n Checking the display for a 1x1 board with no mines... OK\r\n Checking the display for a 5x3 board with no mines... OK\r\n Checking the display for a 3x5 board with no mines... OK\r\n Checking the display for a 5x5 board with no mines... OK\r\n\r\n Question 10 [1 point] - Displaying board's mine cells:\r\n Checking the display for a 1x1 board full of mines... OK\r\n Checking the display for a 5x3 board full of mines... OK\r\n Checking the display for a 3x5 board full of mines... OK\r\n Checking the display for a 10x10 board full of mines... OK\r\n\r\n Question 11 [1 point] - Displaying empty board message:\r\n Checking the empty message... OK\r\n\r\n Question 12 [0.5 points] - Return to the menu after displaying the board:\r\n Checking the menu display... OK\r\n\r\n TOTAL SCORE: 10 / 10", s.Output.ToString());
}
[Test, Category("Mineseeker"), Category("Real"), Category("Local")]
public void Real_Mineseeker_SCRIPT_SINGLE_ERRORS()
{
var s = new AutoCheck.Core.Script(GetSampleFile("real_mineseeker_single_6.yaml"));
- Assert.AreEqual("Running script 'DAM - M03 (UF1): Mineseeker' (v1.0.1.0):\r\nRunning on single mode for 'Student_Name_6':\r\n Question 1 [0.5 points] - Checking main java file:\r\n Looking for .java... OK\r\n Loading the file Main.java... OK\r\n Compiling the file Main.java... OK\r\n\r\n Question 2 [1 point] - Main menu:\r\n Checking the caption... ERROR:\n -Expected -> %Escull una opció:%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n Checking the first option... ERROR:\n -Expected -> %1. Emplenar el taulell%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n Checking the second option... ERROR:\n -Expected -> %2. Mostrar el taulell%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n Checking the third option... ERROR:\n -Expected -> %3. Sortir%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n Question 3 [1 point] - Input data:\r\n Checking the input data giving no data... OK\r\n Checking the input data giving rows... OK\r\n Checking the input data giving rows and columns... OK\r\n Checking the input question for the rows... ERROR:\n -Expected -> %De quantes files vols el taulell?%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nfiles al taulell?\ncolumnes al taulell?\nmines al taulell?\n1 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n Checking the input question for the columns... ERROR:\n -Expected -> %De quantes columnes vols el taulell?%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nfiles al taulell?\ncolumnes al taulell?\nmines al taulell?\n1 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n Checking the input question for the mines... ERROR:\n -Expected -> %Quantes mines vols al taulell?%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nfiles al taulell?\ncolumnes al taulell?\nmines al taulell?\n1 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n Question 4 [0.5 points] - Data verification:\r\n Checking that more mines that cells is not allowed... ERROR:\n -Expected -> %NO ES PODEN POSAR MÉS MINES QUE CASELLES%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nfiles al taulell?\ncolumnes al taulell?\nmines al taulell?\nNO ES PODEN POSAR MÉS MINES\nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n Question 5 [1 point] - Board internal creation:\r\n Checking the internal board creation... OK\r\n Checking the internal board sizing... OK\r\n\r\n Question 6 [1 point] - Board mines filling:\r\n Checking the mine cell filling... OK\r\n\r\n Question 7 [1 point] - Random mines positioning:\r\n Checking that random location is being used... ERROR:\n -Expected -> >0; Found -> 0\r\n\r\n Question 8 [0.5 points] - Return to the menu after filling the board:\r\n Checking the return to the main menu... ERROR:\n -Expected -> %Escull una opció:%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nfiles al taulell?\ncolumnes al taulell?\nmines al taulell?\n1 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n Question 9 [1 point] - Displaying board's empty cells:\r\n Checking the display for a 1x1 board with no mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 5x3 board with no mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 3x5 board with no mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 5x5 board with no mines... ERROR:\n -Expected -> 1; Found -> 0\r\n\r\n Question 10 [1 point] - Displaying board's mine cells:\r\n Checking the display for a 1x1 board full of mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 5x3 board full of mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 3x5 board full of mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 5x5 board full of mines... ERROR:\n -Expected -> 1; Found -> 0\r\n\r\n Question 11 [1 point] - Displaying empty board message:\r\n Checking the empty message... ERROR:\n -Expected -> %NO S’HA CREAT CAP TAULELL%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nNO S’HA CREAT\nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n Question 12 [0.5 points] - Return to the menu after displaying the board:\r\n Checking the empty message... ERROR:\n -Expected -> %NO S’HA CREAT CAP TAULELL%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nNO S’HA CREAT\nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n Checking the menu display... ERROR:\n -Expected -> %Escull una opció:%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nNO S’HA CREAT\nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n TOTAL SCORE: 2.5 / 10", s.Output.ToString());
+ Assert.AreEqual("Running script 'DAM - M03 (UF1): Mineseeker' (v1.0.1.2):\r\nRunning on single mode for 'Student_Name_6':\r\n Question 1 [0.5 points] - Checking main java file:\r\n Looking for .java... OK\r\n Loading the file Main.java... OK\r\n Compiling the file Main.java... OK\r\n\r\n Question 2 [1 point] - Main menu:\r\n Checking the caption... ERROR:\n -Expected -> %Escull una opció:%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n Checking the first option... ERROR:\n -Expected -> %1. Emplenar el taulell%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n Checking the second option... ERROR:\n -Expected -> %2. Mostrar el taulell%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n Checking the third option... ERROR:\n -Expected -> %3. Sortir%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n Question 3 [1 point] - Input data:\r\n Checking the input data giving no data... OK\r\n Checking the input data giving rows... OK\r\n Checking the input data giving rows and columns... OK\r\n Checking the input question for the rows... ERROR:\n -Expected -> %De quantes files vols el taulell?%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nfiles al taulell?\ncolumnes al taulell?\nmines al taulell?\n1 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n Checking the input question for the columns... ERROR:\n -Expected -> %De quantes columnes vols el taulell?%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nfiles al taulell?\ncolumnes al taulell?\nmines al taulell?\n1 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n Checking the input question for the mines... ERROR:\n -Expected -> %Quantes mines vols al taulell?%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nfiles al taulell?\ncolumnes al taulell?\nmines al taulell?\n1 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n Question 4 [0.5 points] - Data verification:\r\n Checking that more mines that cells is not allowed... ERROR:\n -Expected -> %NO ES PODEN POSAR MÉS MINES QUE CASELLES%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nfiles al taulell?\ncolumnes al taulell?\nmines al taulell?\nNO ES PODEN POSAR MÉS MINES\nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n Question 5 [1 point] - Board internal creation:\r\n Checking the internal board creation... OK\r\n Checking the internal board sizing... OK\r\n\r\n Question 6 [1 point] - Board mines filling:\r\n Checking the mine cell filling... OK\r\n\r\n Question 7 [1 point] - Random mines positioning:\r\n Checking that random location is being used... ERROR:\n -Expected -> >0; Found -> 0\r\n\r\n Question 8 [0.5 points] - Return to the menu after filling the board:\r\n Checking the return to the main menu... ERROR:\n -Expected -> %Escull una opció:%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nfiles al taulell?\ncolumnes al taulell?\nmines al taulell?\n1 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \n0 0 0 0 \nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n Question 9 [1 point] - Displaying board's empty cells:\r\n Checking the display for a 1x1 board with no mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 5x3 board with no mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 3x5 board with no mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 5x5 board with no mines... ERROR:\n -Expected -> 1; Found -> 0\r\n\r\n Question 10 [1 point] - Displaying board's mine cells:\r\n Checking the display for a 1x1 board full of mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 5x3 board full of mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 3x5 board full of mines... ERROR:\n -Expected -> 1; Found -> 0\r\n Checking the display for a 10x10 board full of mines... ERROR:\n -Expected -> 1; Found -> 0\r\n\r\n Question 11 [1 point] - Displaying empty board message:\r\n Checking the empty message... ERROR:\n -Expected -> %HA CREAT CAP TAULELL%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nNO S’HA CREAT\nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n Question 12 [0.5 points] - Return to the menu after displaying the board:\r\n Checking the menu display... ERROR:\n -Expected -> %Escull una opció:%; Found -> Escull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\n\nNO S’HA CREAT\nEscull la opció: \n 1) Emplenar el taulell\n 2) Mostrar el taulell\n 3) Sortir\r\n\r\n TOTAL SCORE: 2.5 / 10", s.Output.ToString());
}
[Test, Category("Mineseeker"), Category("Real"), Category("Local")]
- public void Real_Mineseeker_SCRIPT_BATCH_1()
+ public void Real_Mineseeker_SCRIPT_BATCH_RANDOM_CODE()
{
//The java files are not mineseeker code, so all scores will be 0, but goes well to test the copy detector for java code.
var s = new AutoCheck.Core.Script(GetSampleFile("real_mineseeker_batch_1.yaml"));
- Assert.AreEqual("Running script DAM - M03 (UF1): Mineseeker (v1.0.1.0):\r\n Starting the copy detector for SourceCode:\r\n Looking for potential copies within Student Name 1... OK\r\n Looking for potential copies within Student Name 2... OK\r\n Looking for potential copies within Student Name 3... OK\r\n\r\n Starting the copy detector for SourceCode:\r\n Looking for potential copies within Student Name 1... ERROR:\n -Unable to find any file using the search pattern 'E2.java'.\r\n Looking for potential copies within Student Name 2... OK\r\n Looking for potential copies within Student Name 3... OK\r\n\r\n Starting the copy detector for SourceCode:\r\n Looking for potential copies within Student Name 1... OK\r\n Looking for potential copies within Student Name 2... OK\r\n Looking for potential copies within Student Name 3... OK\r\n\r\nRunning on batch mode for Student Name 1:\r\n No potential copy detected for Student Name 1/E1.java:\r\n Match score with Student Name 2/E1.java... 54,80 %\r\n Match score with Student Name 3/E1.java... 52,30 %\r\n\r\n The copy detector was unable to find and compare some files using the search pattern Student Name 1/E2.java:\r\n\r\n No potential copy detected for Student Name 1/E3.java:\r\n Match score with Student Name 2/E3.java... 54,80 %\r\n Match score with Student Name 3/E3.java... 52,30 %\r\n\r\n Warning: some files were not found when performing the copy detection mechanism.\r\n\r\n Question 1 [0.5 points] - Checking main java file:\r\n Looking for .java... OK\r\n Loading the file E3.java... OK\r\n Compiling the file E3.java... ERROR:\n -Expected -> ; Found -> error: invalid flag: /home/fher/repos/AutoCheck/test/../test/samples/private/java/Student\nUsage: javac