Compare commits
2 Commits
a616ab63e4
...
de1f3c59d6
| Author | SHA1 | Date | |
|---|---|---|---|
| de1f3c59d6 | |||
| c0a3f85f24 |
@@ -112,11 +112,11 @@ public class MultiDoku {
|
|||||||
* @return boolean, true s'il est valide et false sinon.
|
* @return boolean, true s'il est valide et false sinon.
|
||||||
*/
|
*/
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
boolean result = true;
|
|
||||||
for (Sudoku sudoku : this.subGrids) {
|
for (Sudoku sudoku : this.subGrids) {
|
||||||
result = sudoku.isValid() && result;
|
if(!sudoku.isValid())
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return result;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package sudoku;
|
package sudoku;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -25,6 +26,9 @@ public class SudokuSerializerTest {
|
|||||||
try {
|
try {
|
||||||
otherDoku = SudokuFactory.fromfile(savePath);
|
otherDoku = SudokuFactory.fromfile(savePath);
|
||||||
assert (otherDoku != null);
|
assert (otherDoku != null);
|
||||||
|
// clean file after test
|
||||||
|
File fileToDelete = new File(savePath);
|
||||||
|
fileToDelete.delete();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
assert false;
|
assert false;
|
||||||
|
|||||||
Reference in New Issue
Block a user