From 80328d533185de64294129c11dff19aea0dedbe8 Mon Sep 17 00:00:00 2001 From: Rory Martin <36866664+Rorymar@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:51:38 -0500 Subject: [PATCH] Tree Tent Test Suite- All Remaining Non-Case Type Tests (#683) * TooManyTents Test Overhaul Overhauled the TooManyTents Tests to better account for possible situations, and improved commenting. * TooFewTents Tests Added more expansive tests for the TooFewTents rule * Fill With Tests Completed the Fill With Test Overhaul * Last Camping Spot Test Updated the Last Camping Spot Test to be commented and more comprehensive. * Test suite branch -- BulbsInPathContradictionRuleTest (#674) * Region Based Changes (#559) Co-authored-by: Hanson Gu <123511202+hansongu123@users.noreply.github.com> * Short Truth Table Puzzle Editor (#451) * Created files for STT elements * Renamed Tiles classes to Elements to match package name Also added an elements reference sheet and renamed rules reference sheet accordingly * More progress made This won't compile, just saving progress made * More progress being made * Fixed file name typo and added placeholder tiles * Added image paths * Created element classes and added placeholder tile images (#452) * Renamed Tiles classes to Elements to match package name Also added an elements reference sheet and renamed rules reference sheet accordingly * More progress made This won't compile, just saving progress made * More progress being made * Fixed file name typo and added placeholder tiles * Added image paths * Set the current board on boardView * Fixed typo and turned on STT puzzle editor for testing * Added preliminary valid dimensions checker This will most definitely change in the future, hopefully can change to accept a number of statements * Fixed image file paths * Added ActionListener Allows us to determine what puzzle is selected by the user * Hide rows and columns input for Short Truth Table * Added text area for Short Truth Table * Added scrollbars to show up as needed * Reformatted code * More code reformatting * Even more reformatting * Separate the data from the TextArea into different lines * Did some researching/testing Tested certain variable values with a STT file with no true/false values * Made more progress Added new methods to handle creating Short Truth Table boards from an array of strings * Added a bunch of TODOs - Implemented a couple functions to be used later - Added a bunch of TODO comments for future work * Made some more progress * Implemented abstract methods from PuzzleImporter * Added abstract methods to Fillapix and added other exception reporting * CheckStyle formatting * Removed a TODO comment * Statements show up in puzzle editor Fixed a bug where the importer was not properly being initialized. Statements now show up in the puzzle editor. * Removed empty statements * Changed InvalidFormatException to IllegalArgumentException * Remove argument that has already been caught * Removed elements that will not be used * Added puzzle editor cell clicking functionality * Added ability to toggle certain logical elements * New icons and more functionality implemented * Fixed a bug where spacer rows could be modified * Added statement error checking * Fixed formatting * Only one logic symbol element needed * Changed InputMismatchException to UnsupportedOperationException * Renamed variables to not be STT specific * Finding initial issue and starting fix * Issue is statement copying and modifying * STT exporter now working. Overrode setCell for STTBoard. * Added code documentation * removed testing println() * Gradle fixes * Revert "Merge pull request #545 from MMosley502/puzzle_editor-short_truth_table-file_saving" This reverts commit 2e82547896a7fb3e52ec27634cd8938ef299732f, reversing changes made to beb60a2ab67c8317d404f54e52471739f698bf22. * Saving files now works * Fixed the blank element to be categorized as a placeable element * Fixed a bug where file wouldn't save due to batch grader updates * Reformatted code in STT * Reformatted code again * MORE REFORMATTING Pls like my code CheckStyle --------- Co-authored-by: Matthew Mosley Co-authored-by: MMosley502 <74743867+MMosley502@users.noreply.github.com> * Have null changes be valid and fix IsolatedBlackContradicitonRule error message (#561) * Get Tests to be called Revert "Create first cypress test template" This reverts commit 3e50909b93b5aa9634cf0d296e9aeff756b0a909. First commit Finish Lightup tests * Add more tests Update TestRunner.java * Somehow ended up in the wrong spot Fix Import * Please let this be the fix Update TreeTransition.java Update TreeTransition.java Update DirectRule.java Check to see which is not correct Update ElementController.java Revert "maybe the null is making it think that it's not valid" This reverts commit 7bf1de0d66ced6749ee37fbb9c252636b2fcdc79. Just trying to change color Revert "Just trying to change color" This reverts commit ec44695ee578d664055d135a668927a0fd900f5d. Revert "maybe the null is making it think that it's not valid" This reverts commit 3f162fbdc32e6fbd23da321a14a6af96f0ff520d. Check to see which is not correct Revert "Check to see which is not correct" This reverts commit 136b0a41b9d103e6f3e9a7f8cd5d970bf76b050b. Update TreeTransition.java Update TreeTransition.java Revert "Update TreeTransition.java" This reverts commit cde45bb9001cfbfa4f6e2a49b4e9990d2fa7ad33. * Fix error with isolated Black Fix error message with isolated black * Removed excess whitespace and imports. Added short JavaDoc for `TestRunner.java` --------- Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com> Co-authored-by: Bram van Heuveln Co-authored-by: Corppet * Fixed a bug * Update BlackTile.java Black tile should not be placeable * Added unknown tile stuff * ID error * Some Fixes to Recently Discussed UX Bugs (#563) * frame and panels default sizes, default pos on screen * hardcoded version number * homepanel default size * set panels' own sizes * some changes * Removed unused import --------- Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com> Co-authored-by: Corppet * Oops pushed the wrong file Yeah some tiles work now but this is the ID error * Number Tile working * Update Exporter (#627) * Update Exporter * Delete Test_Save --------- Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com> * Create run-tests.yml * Update run-tests.yml * Update run-tests.yml * Update run-tests.yml * Update run-tests.yml * Windows things * Added print messages * More Windows things * Debugging * Update run-tests.yml * Update run-tests.yml * Maybe this will work now? * Didn't work * Update run-tests.yml * Update run-tests.yml * Create DummyTest.java For debugging purposes * Added another dummy test * Update run-tests.yml * Update run-tests.yml Get rid of all this info * Deleted the dummy tests * BulbsInPathContradictionRuleTest looks good. I added one more function to check for the BlockInHorizontalPath test case. * I think I might have run into a problem on the testing function. I will confirm this problem next time and will write another test case. * I made another puzzle and test case to check what would happen if the cells could actually be lit, meaning there would be no contradiction. The test case passed and so I think CannotLightACellContradictionRule works correctly for all cases. * I made another puzzle and test case to check what would happen if the cells could actually be lit, meaning there would be no contradiction. The test case passed and so I think CannotLightACellContradictionRule works correctly for all cases. --------- Co-authored-by: Antonio Orta <60408336+19690ao@users.noreply.github.com> Co-authored-by: Hanson Gu <123511202+hansongu123@users.noreply.github.com> Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com> Co-authored-by: Matthew Mosley Co-authored-by: MMosley502 <74743867+MMosley502@users.noreply.github.com> Co-authored-by: Viane Matsibekker <117249183+04vmatsibekker@users.noreply.github.com> Co-authored-by: Bram van Heuveln Co-authored-by: Corppet Co-authored-by: charlestian23 Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com> Co-authored-by: ThisMatt <98851950+ThisMatt@users.noreply.github.com> * Revert "Test suite branch -- BulbsInPathContradictionRuleTest (#674)" (#687) This reverts commit 6afa15c57fca05a9b8da4b4f27b88dd55d69bfb8. * TooFewTents Overhaul --------- Co-authored-by: pitbull51067 <103721450+pitbull51067@users.noreply.github.com> Co-authored-by: Antonio Orta <60408336+19690ao@users.noreply.github.com> Co-authored-by: Hanson Gu <123511202+hansongu123@users.noreply.github.com> Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com> Co-authored-by: Matthew Mosley Co-authored-by: MMosley502 <74743867+MMosley502@users.noreply.github.com> Co-authored-by: Viane Matsibekker <117249183+04vmatsibekker@users.noreply.github.com> Co-authored-by: Bram van Heuveln Co-authored-by: Corppet Co-authored-by: charlestian23 Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com> Co-authored-by: ThisMatt <98851950+ThisMatt@users.noreply.github.com> --- .../rules/FinishWithTentsDirectRuleTest.java | 2 +- .../rules/LastCampingSpotDirectRuleTest.java | 111 ++++++++- .../rules/TentOrGrassCaseRuleTest.java | 54 +++++ .../TooFewTentsContradictionRuleTest.java | 216 ++++++++++++++++- .../TooManyTentsContradictionRuleTest.java | 228 +++++++++++++++++- .../FinishWithGrassJustRow | 20 ++ .../FinishWithGrassJustTent | 16 ++ .../FinishWithTentsBothWays | 20 ++ .../LastCampingSpotDown | 23 ++ .../LastCampingSpotLeft | 23 ++ .../LastCampingSpotRight | 23 ++ .../{LastCampingSpot => LastCampingSpotUp} | 0 .../rules/TentOrGrassCaseRule/TentOrGrassTest | 20 ++ .../TooFewTents2x2Column | 19 ++ .../TooFewTents2x2Row | 19 ++ .../TooFewTents3x3Column | 22 ++ .../TooFewTents3x3DoubleColumn | 27 +++ .../TooFewTentsDoubleBad | 16 ++ .../{TooFewTents => TooFewTentsJustY} | 0 .../TooFewTentsNoContradiction | 19 ++ .../TooFewTentsWithTent | 16 ++ .../TooManyTentsBottomAccount | 22 ++ ...nRuleColumn_Row => TooManyTentsBottomDown} | 2 +- .../TooManyTentsBottomMissDown | 22 ++ .../TooManyTentsBottomMissRight | 22 ++ .../TooManyTentsBottomRight | 22 ++ .../TooManyTentsTopAccount | 22 ++ .../TooManyTentsTopDown | 22 ++ .../TooManyTentsTopRight | 22 ++ .../TooManyTentsTotalFail | 22 ++ 30 files changed, 1057 insertions(+), 15 deletions(-) create mode 100644 src/test/java/puzzles/treetent/rules/TentOrGrassCaseRuleTest.java create mode 100644 src/test/resources/puzzles/treetent/rules/FinishWithGrassDirectRule/FinishWithGrassJustRow create mode 100644 src/test/resources/puzzles/treetent/rules/FinishWithGrassDirectRule/FinishWithGrassJustTent create mode 100644 src/test/resources/puzzles/treetent/rules/FinishWithTentsDirectRule/FinishWithTentsBothWays create mode 100644 src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotDown create mode 100644 src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotLeft create mode 100644 src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotRight rename src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/{LastCampingSpot => LastCampingSpotUp} (100%) create mode 100644 src/test/resources/puzzles/treetent/rules/TentOrGrassCaseRule/TentOrGrassTest create mode 100644 src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents2x2Column create mode 100644 src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents2x2Row create mode 100644 src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents3x3Column create mode 100644 src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents3x3DoubleColumn create mode 100644 src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsDoubleBad rename src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/{TooFewTents => TooFewTentsJustY} (100%) create mode 100644 src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsNoContradiction create mode 100644 src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsWithTent create mode 100644 src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomAccount rename src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/{TooManyTentsContradictionRuleColumn_Row => TooManyTentsBottomDown} (93%) create mode 100644 src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomMissDown create mode 100644 src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomMissRight create mode 100644 src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomRight create mode 100644 src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopAccount create mode 100644 src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopDown create mode 100644 src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopRight create mode 100644 src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTotalFail diff --git a/src/test/java/puzzles/treetent/rules/FinishWithTentsDirectRuleTest.java b/src/test/java/puzzles/treetent/rules/FinishWithTentsDirectRuleTest.java index dff292977..725c3c9de 100644 --- a/src/test/java/puzzles/treetent/rules/FinishWithTentsDirectRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/FinishWithTentsDirectRuleTest.java @@ -126,7 +126,7 @@ public void FinishWithTentsTest() throws InvalidFileFormatException { TreeTentCell cell2 = board.getCell(1, 2); TreeTentCell cell3 = board.getCell(0, 1); TreeTentCell cell4 = board.getCell(2, 1); - + cell1.setData(TreeTentType.TENT); cell2.setData(TreeTentType.TENT); cell3.setData(TreeTentType.TENT); diff --git a/src/test/java/puzzles/treetent/rules/LastCampingSpotDirectRuleTest.java b/src/test/java/puzzles/treetent/rules/LastCampingSpotDirectRuleTest.java index 415b4f4b9..3e1b390fb 100644 --- a/src/test/java/puzzles/treetent/rules/LastCampingSpotDirectRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/LastCampingSpotDirectRuleTest.java @@ -27,9 +27,14 @@ public static void setUp() { treetent = new TreeTent(); } + /** + * @throws InvalidFileFormatException + * + * Checks if a test works for an empty square above a tree which is surrounded on all other sides. + */ @Test - public void EmptyFieldTest() throws InvalidFileFormatException { - TestUtilities.importTestBoard("puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpot", treetent); + public void EmptyFieldTest_Up() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotUp", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); @@ -55,6 +60,108 @@ public void EmptyFieldTest() throws InvalidFileFormatException { } } } + + /** + * @throws InvalidFileFormatException + * + * Checks if a test works for an empty square below a tree which is surrounded on all other sides. + */ + @Test + public void EmptyFieldTest_Down() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotDown", treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + TreeTentCell cell1 = board.getCell(1, 2); + cell1.setData(TreeTentType.TENT); + + board.addModifiedData(cell1); + + Assert.assertNull(RULE.checkRule(transition)); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation())) { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * + * Checks if a test works for an empty square to the left of a tree which is surrounded on all other sides. + */ + @Test + public void EmptyFieldTest_Left() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotLeft", treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + TreeTentCell cell1 = board.getCell(0, 1); + cell1.setData(TreeTentType.TENT); + + board.addModifiedData(cell1); + + Assert.assertNull(RULE.checkRule(transition)); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation())) { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * + * Checks if a test works for an empty square to the right of a tree which is surrounded on all other sides. + */ + @Test + public void EmptyFieldTest_Right() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotRight", treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + TreeTentCell cell1 = board.getCell(2, 1); + cell1.setData(TreeTentType.TENT); + + board.addModifiedData(cell1); + + Assert.assertNull(RULE.checkRule(transition)); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation())) { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } } diff --git a/src/test/java/puzzles/treetent/rules/TentOrGrassCaseRuleTest.java b/src/test/java/puzzles/treetent/rules/TentOrGrassCaseRuleTest.java new file mode 100644 index 000000000..c7159ccad --- /dev/null +++ b/src/test/java/puzzles/treetent/rules/TentOrGrassCaseRuleTest.java @@ -0,0 +1,54 @@ +package puzzles.treetent.rules; + +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.tree.Tree; +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.treetent.TreeTent; +import edu.rpi.legup.puzzle.treetent.TreeTentBoard; +import edu.rpi.legup.puzzle.treetent.TreeTentCell; +import edu.rpi.legup.puzzle.treetent.TreeTentType; +import edu.rpi.legup.puzzle.treetent.rules.FillinRowCaseRule; +import edu.rpi.legup.puzzle.treetent.rules.TentOrGrassCaseRule; +import edu.rpi.legup.save.InvalidFileFormatException; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.awt.*; +import java.util.ArrayList; + +public class TentOrGrassCaseRuleTest { + private static final TentOrGrassCaseRule RULE = new TentOrGrassCaseRule(); + private static TreeTent treetent; + + @BeforeClass + public static void setUp(){ + MockGameBoardFacade.getInstance(); + treetent = new TreeTent(); + } + + /** + * @throws InvalidFileFormatException + * A temporary test + */ + @Test + public void TentOrGrassCaseRule_Test() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/TentOrGrassCaseRule/TentOrGrassTest", treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + TreeTentCell testing_cell = board.getCell(1, 0); + ArrayList cases = RULE.getCases(board, testing_cell); + // assert correct number of cases created + Assert.assertEquals(2, cases.size()); + //Store the 0,1 cells from each case + //Assert that the Array of their states match to a an array of the expected. + + } + +} diff --git a/src/test/java/puzzles/treetent/rules/TooFewTentsContradictionRuleTest.java b/src/test/java/puzzles/treetent/rules/TooFewTentsContradictionRuleTest.java index bfcb80a23..a5999dc6e 100644 --- a/src/test/java/puzzles/treetent/rules/TooFewTentsContradictionRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/TooFewTentsContradictionRuleTest.java @@ -1,5 +1,6 @@ package puzzles.treetent.rules; +import edu.rpi.legup.puzzle.treetent.TreeTentCell; import legup.MockGameBoardFacade; import legup.TestUtilities; import edu.rpi.legup.model.tree.TreeNode; @@ -10,8 +11,6 @@ import edu.rpi.legup.puzzle.treetent.TreeTent; import edu.rpi.legup.puzzle.treetent.TreeTentBoard; -import edu.rpi.legup.puzzle.treetent.TreeTentCell; -import edu.rpi.legup.puzzle.treetent.TreeTentType; import edu.rpi.legup.puzzle.treetent.rules.TooFewTentsContradictionRule; import edu.rpi.legup.save.InvalidFileFormatException; @@ -28,9 +27,46 @@ public static void setUp() { treetent = new TreeTent(); } + /** + * @throws InvalidFileFormatException + * Using a 1x1 Puzzle Grid, which is just grass, checks if the fact it expects a tent on the y-axis is caught. + */ + @Test + public void TooFewTentsContradictionRule_JustY() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsJustY", treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + Assert.assertNull(RULE.checkContradiction(board)); + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(0, 0))); + } + + /** + * @throws InvalidFileFormatException + * Using a 1x1 Puzzle Grid, which is just a tent, checks if the fact it expects 2 tents on the y-axis is caught. + * (This is an impossible situation given the constraints, but for the purposes of the test it is fine) + */ + @Test + public void TooFewTentsContradictionRule_WithTent() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsWithTent", treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + Assert.assertNull(RULE.checkContradiction(board)); + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(0, 0))); + } + + /** + * @throws InvalidFileFormatException + * Using a 1x1 Puzzle Grid, which is just grass, checks if the fact it expects a tent on both x and y is caught. + */ @Test - public void TooFewTentsContradictionRule_() throws InvalidFileFormatException { - TestUtilities.importTestBoard("puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents", treetent); + public void TooFewTentsContradictionRule_DoubleBad() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsDoubleBad", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); @@ -39,5 +75,177 @@ public void TooFewTentsContradictionRule_() throws InvalidFileFormatException { Assert.assertNull(RULE.checkContradiction(board)); Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(0, 0))); } + + /** + * @throws InvalidFileFormatException + * Looks at a 2x2 Board in the format: + * [] Tr + * [] Gr + * Column 2 is checked to have 1 Tent (which is not present, thus producing a contradiction) + */ + @Test + public void TooFewTentsContradictionRule_2x2ColumnOnly() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents2x2Column",treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + Assert.assertNull(RULE.checkContradiction(board)); + + TreeTentCell cell1 = board.getCell(1,0); + TreeTentCell cell2 = board.getCell(1,1); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation())) { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * Looks at a 2x2 Board in the format: + * Tr Gr + * [] [] + * Row 1 is checked to have 1 Tent (which is not present, thus producing a contradiction) + */ + @Test + public void TooFewTentsContradictionRule_2x2RowOnly() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents2x2Row",treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + Assert.assertNull(RULE.checkContradiction(board)); + + TreeTentCell cell1 = board.getCell(0,0); + TreeTentCell cell2 = board.getCell(1,0); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation())) { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * Looks at a 3x3 Board in the format: + * [] Tr [] + * [] Gr [] + * [] Gr [] + * Column 2 is checked to have 1 Tent (which is not present, thus producing a contradiction) + */ + @Test + public void TooFewTentsContradictionRule_3x3OneColumn() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents3x3Column",treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + Assert.assertNull(RULE.checkContradiction(board)); + + TreeTentCell cell1 = board.getCell(1,0); + TreeTentCell cell2 = board.getCell(1,1); + TreeTentCell cell3 = board.getCell(1,2); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation()) || point.equals(cell3.getLocation())) { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * Looks at a 3x3 Board in the format: + * Gr Tr Gr + * Gr [] Gr + * Gr Tr Gr + * Column 1 and 3 are checked to have 1 Tent (which is not present, thus producing a contradiction) + */ + @Test + public void TooFewTentsContradictionRule_3x3TwoColumn() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents3x3DoubleColumn",treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + Assert.assertNull(RULE.checkContradiction(board)); + + TreeTentCell cell1 = board.getCell(0,0); + TreeTentCell cell2 = board.getCell(0,1); + TreeTentCell cell3 = board.getCell(0,2); + TreeTentCell cell4 = board.getCell(2,0); + TreeTentCell cell5 = board.getCell(2,1); + TreeTentCell cell6 = board.getCell(2,2); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation()) || point.equals(cell3.getLocation()) || + point.equals(cell4.getLocation()) || point.equals(cell5.getLocation()) || point.equals(cell6.getLocation())) { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * Looks at a 2x2 Board in the format: + * Tn [] + * Tr [] + * This should fail the contradiction as it is a legal board. + */ + @Test + public void TooFewTentsContradictionRule_NoContradiction() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsNoContradiction",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/java/puzzles/treetent/rules/TooManyTentsContradictionRuleTest.java b/src/test/java/puzzles/treetent/rules/TooManyTentsContradictionRuleTest.java index 2845c7b25..2a351556b 100644 --- a/src/test/java/puzzles/treetent/rules/TooManyTentsContradictionRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/TooManyTentsContradictionRuleTest.java @@ -28,17 +28,162 @@ public static void setUp() { treetent = new TreeTent(); } + /* + TESTING BASIS: + All test in this Rule use a 3x3 table. + There is a Tree at (1,1) + There are tents at (0,1) and (2,2) + All Tent Counts are listed left to right or top to bottom + */ + + /** + * @throws InvalidFileFormatException + * Tests for TooManyTents if: + * Row Tent Counts: 0,0,0 + * Column Tent Counts: 0,0,0 + */ + @Test + public void TooManyTentsContradictionRule_TotalFail() throws InvalidFileFormatException{ + TestUtilities.importTestBoard("puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTotalFail",treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + TreeTentCell cell1 = board.getCell(0,1); + + Assert.assertNull(RULE.checkContradiction(board)); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation())) { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * Tests for TooManyTents if: + * Row Tent Counts: 1,0,0 + * Column Tent Counts: 0,0,0 + */ + @Test + public void TooManyTentsContradictionRule_TopRight() throws InvalidFileFormatException{ + TestUtilities.importTestBoard("puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopRight",treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + TreeTentCell cell1 = board.getCell(0,0); + TreeTentCell cell2 = board.getCell(0,1); + + Assert.assertNull(RULE.checkContradiction(board)); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation())) { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * Tests for TooManyTests if: + * Row Tent Counts: 0,0,1 + * Column Tent Counts: 0,0,0 + */ + @Test + public void TooManyTentsContradictionRule_BottomRight() throws InvalidFileFormatException{ + TestUtilities.importTestBoard("puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomRight",treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + TreeTentCell cell1 = board.getCell(0,1); + TreeTentCell cell2 = board.getCell(0,2); + + Assert.assertNull(RULE.checkContradiction(board)); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation())) { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * Tests for TooManyTents if: + * Row Tent Counts: 0,0,0 + * Column Tent Counts: 0,1,0 + */ + @Test + public void TooManyTentsContradictionRule_TopDown() throws InvalidFileFormatException{ + TestUtilities.importTestBoard("puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopDown",treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + TreeTentCell cell1 = board.getCell(0,1); + TreeTentCell cell2 = board.getCell(1,1); + + Assert.assertNull(RULE.checkContradiction(board)); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation())) { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * Tests for TooManyTents if: + * Row Tent Counts: 0,0,0 + * Column Tent Counts: 0,0,1 + */ @Test - public void TooManyTentsContradictionRule_Column_Row() throws InvalidFileFormatException { - TestUtilities.importTestBoard("puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsContradictionRuleColumn_Row", treetent); + public void TooManyTentsContradictionRule_BottomDown() throws InvalidFileFormatException{ + TestUtilities.importTestBoard("puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomDown",treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); TreeTentBoard board = (TreeTentBoard) transition.getBoard(); - TreeTentCell cell1 = board.getCell(0, 1); - TreeTentCell cell2 = board.getCell(2, 1); + TreeTentCell cell1 = board.getCell(0,1); + TreeTentCell cell2 = board.getCell(2,1); Assert.assertNull(RULE.checkContradiction(board)); @@ -49,9 +194,78 @@ public void TooManyTentsContradictionRule_Column_Row() throws InvalidFileFormatE Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); } else { - // The TooManyTentsContradictionRule checks the col and row the cell is in - // Therefore, even if a cell(0, 0) is empty, it follows the contradiction rule because - // the row it is in follows the contradiciton rule. (And because cell(1, 0) has tent row tent total is 0) + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * Tests for TooManyTents if the Top Tent is completely accounted for, but not the bottom + * Row Tent Counts: 1,0,0 + * Column Tent Counts: 0,1,0 + */ + @Test + public void TooManyTentsContradictionRule_TopAccount() throws InvalidFileFormatException{ + TestUtilities.importTestBoard("puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopAccount",treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + TreeTentCell cell1 = board.getCell(0,0); + TreeTentCell cell2 = board.getCell(1,0); + TreeTentCell cell3 = board.getCell(0,1); + TreeTentCell cell4 = board.getCell(1,1); + + Assert.assertNull(RULE.checkContradiction(board)); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation()) || + point.equals(cell3.getLocation()) || point.equals(cell4.getLocation())) { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { + Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + } + } + } + + /** + * @throws InvalidFileFormatException + * Tests for TooManyTents if the Bottom Tent is completely accounted for, but not the Top + * Row Tent Counts: 0,0,1 + * Column Tent Counts: 0,0,1 + */ + @Test + public void TooManyTentsContradictionRule_BottomAccount() throws InvalidFileFormatException{ + TestUtilities.importTestBoard("puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomAccount",treetent); + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + TreeTentCell cell1 = board.getCell(0,1); + TreeTentCell cell2 = board.getCell(2,1); + TreeTentCell cell3 = board.getCell(0,2); + TreeTentCell cell4 = board.getCell(2,2); + + Assert.assertNull(RULE.checkContradiction(board)); + + for (int i = 0; i < board.getHeight(); i++) { + for (int k = 0; k < board.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation()) || + point.equals(cell3.getLocation()) || point.equals(cell4.getLocation())) { + Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); + } + else { Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); } } diff --git a/src/test/resources/puzzles/treetent/rules/FinishWithGrassDirectRule/FinishWithGrassJustRow b/src/test/resources/puzzles/treetent/rules/FinishWithGrassDirectRule/FinishWithGrassJustRow new file mode 100644 index 000000000..3e293d22f --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/FinishWithGrassDirectRule/FinishWithGrassJustRow @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/FinishWithGrassDirectRule/FinishWithGrassJustTent b/src/test/resources/puzzles/treetent/rules/FinishWithGrassDirectRule/FinishWithGrassJustTent new file mode 100644 index 000000000..cbd3662e6 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/FinishWithGrassDirectRule/FinishWithGrassJustTent @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/FinishWithTentsDirectRule/FinishWithTentsBothWays b/src/test/resources/puzzles/treetent/rules/FinishWithTentsDirectRule/FinishWithTentsBothWays new file mode 100644 index 000000000..c4d58ef60 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/FinishWithTentsDirectRule/FinishWithTentsBothWays @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotDown b/src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotDown new file mode 100644 index 000000000..cb19ab33f --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotDown @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotLeft b/src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotLeft new file mode 100644 index 000000000..e70dc4be5 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotLeft @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotRight b/src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotRight new file mode 100644 index 000000000..64ddf29db --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotRight @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpot b/src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotUp similarity index 100% rename from src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpot rename to src/test/resources/puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotUp diff --git a/src/test/resources/puzzles/treetent/rules/TentOrGrassCaseRule/TentOrGrassTest b/src/test/resources/puzzles/treetent/rules/TentOrGrassCaseRule/TentOrGrassTest new file mode 100644 index 000000000..9ae8455e1 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TentOrGrassCaseRule/TentOrGrassTest @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents2x2Column b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents2x2Column new file mode 100644 index 000000000..0f78702c4 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents2x2Column @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents2x2Row b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents2x2Row new file mode 100644 index 000000000..c423b179b --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents2x2Row @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents3x3Column b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents3x3Column new file mode 100644 index 000000000..d1e79a76e --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents3x3Column @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents3x3DoubleColumn b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents3x3DoubleColumn new file mode 100644 index 000000000..e71832f08 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents3x3DoubleColumn @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsDoubleBad b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsDoubleBad new file mode 100644 index 000000000..ecc8988c6 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsDoubleBad @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsJustY similarity index 100% rename from src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTents rename to src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsJustY diff --git a/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsNoContradiction b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsNoContradiction new file mode 100644 index 000000000..2f609e161 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsNoContradiction @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsWithTent b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsWithTent new file mode 100644 index 000000000..8ae51f0a3 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooFewTentsContradictionRule/TooFewTentsWithTent @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomAccount b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomAccount new file mode 100644 index 000000000..8474e916a --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomAccount @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsContradictionRuleColumn_Row b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomDown similarity index 93% rename from src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsContradictionRuleColumn_Row rename to src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomDown index 78e956c35..8051a5501 100644 --- a/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsContradictionRuleColumn_Row +++ b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomDown @@ -8,7 +8,7 @@ - + diff --git a/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomMissDown b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomMissDown new file mode 100644 index 000000000..3cbb1cdb4 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomMissDown @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomMissRight b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomMissRight new file mode 100644 index 000000000..d22778c4e --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomMissRight @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomRight b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomRight new file mode 100644 index 000000000..aeb4cd148 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsBottomRight @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopAccount b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopAccount new file mode 100644 index 000000000..258e32d47 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopAccount @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopDown b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopDown new file mode 100644 index 000000000..58d4bbddf --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopDown @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopRight b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopRight new file mode 100644 index 000000000..dd5b7b935 --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTopRight @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTotalFail b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTotalFail new file mode 100644 index 000000000..9fbb8b82f --- /dev/null +++ b/src/test/resources/puzzles/treetent/rules/TooManyTentsContradictionRule/TooManyTentsTotalFail @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file