implement SudokuSolver.checkRegionPlacement() method and write unit tests
This commit is contained in:
1 parent
2d815af9b8
commit
f99db6a4a5
2 files changed
+132
-6
No files matched your search
@@ -82,5 +82,29 @@ suite('UnitTests', () => {
|
||||
|
||||
});
|
||||
|
||||
test('checkRegionPlacement(puzzleString, row, column, value) valid region placement', (done) => {
|
||||
|
||||
const input = puzzlesAndSolutions[0][0];
|
||||
const row = 'A';
|
||||
const column = '2';
|
||||
const value = '4';
|
||||
|
||||
assert.equal(solver.checkRegionPlacement(input, row, column, value), true);
|
||||
done();
|
||||
|
||||
});
|
||||
|
||||
test('checkRegionPlacement(puzzleString, row, column, value) invalid region placement', (done) => {
|
||||
|
||||
const input = puzzlesAndSolutions[0][0];
|
||||
const row = 'A';
|
||||
const column = '2';
|
||||
const value = '2';
|
||||
|
||||
assert.equal(solver.checkRegionPlacement(input, row, column, value), false);
|
||||
done();
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
Reference in new issue
Block a user