implement SudokuSolver.checkRegionPlacement() method and write unit tests

This commit is contained in:
StevanFreeborn
2022-05-22 23:55:59 -05:00
parent 2d815af9b8
commit f99db6a4a5
2 changed files with 132 additions and 6 deletions
+24
View File
@@ -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();
});
});