diff --git a/src/test/java/puzzles/treetent/rules/TooManyTentsContradictionRuleTest.java b/src/test/java/puzzles/treetent/rules/TooManyTentsContradictionRuleTest.java index 2e542b3d2..6e8b9ba54 100644 --- a/src/test/java/puzzles/treetent/rules/TooManyTentsContradictionRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/TooManyTentsContradictionRuleTest.java @@ -265,4 +265,28 @@ public void TooManyTentsContradictionRule_BottomAccount() throws InvalidFileForm } } } + + /** + * Tests TooManyTents where there is no contradiction + * Row Tent Counts: 1,0,1 Column Tent Counts: 0,1,1 + * @throws InvalidFileFormatException + */ + public void TooManyTentsContradictionRule_NoContradiction() throws InvalidFileFormatException { + TestUtilities.importTestBoard( + "puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsNoContradiction", + treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + Assert.assertNotNull(RULE.checkContradiction(board)); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } } diff --git a/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsNoContradiction b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsNoContradiction new file mode 100644 index 000000000..0a3df60fc --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsNoContradiction @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file