Skip to content

Commit

Permalink
Revert "Test suite branch -- BulbsInPathContradictionRuleTest (#674)" (
Browse files Browse the repository at this point in the history
…#687)

This reverts commit 6afa15c.
  • Loading branch information
charlestian23 authored Nov 9, 2023
1 parent 6afa15c commit 9eb5075
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public void BulbsInPathContradictionRule_LightInHorizontalPath() throws InvalidF
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(2, 0)));


Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 1)));
}

Expand Down Expand Up @@ -68,19 +67,4 @@ public void BulbsInPathContradictionRule_BlockInVerticalPath() throws InvalidFil

Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
}

@Test
public void BulbsInPathContradictionRule_BlockInHorizontalPath() throws InvalidFileFormatException{
TestUtilities.importTestBoard("puzzles/lightup/rules/BulbsInPathContradictionRule/BlockInHorizontalPath", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);

LightUpBoard board = (LightUpBoard) transition.getBoard();
Assert.assertNotNull(RULE.checkContradiction(board));
Assert.assertNotNull(RULE.checkContradictionAt(board,board.getCell(0,0)));
Assert.assertNotNull(RULE.checkContradictionAt(board,board.getCell(2,0)));
Assert.assertNotNull(RULE.checkContradictionAt(board,board.getCell(1,1)));

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ public static void setUp() {
lightUp = new LightUp();
}

@Test
@Test
//extensive full testing of null and non-null in a 5x5 board
public void FullLightTest() throws InvalidFileFormatException {
TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/FullLightTest", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
transition.setRule(RULE);

LightUpBoard board = (LightUpBoard) transition.getBoard();
//confirm there is a contradiction somewhere on the board
Expand All @@ -36,21 +36,21 @@ public void FullLightTest() throws InvalidFileFormatException {
//confirm it is impossible to light up these squares
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(1, 3)));
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(3, 3)));

//confirm these are not required to be lit because they are already lit or unable to be
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 0)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(3, 2)));
}

@Test
@Test
//simple contradiction testing for null and non-null in a 3x3 board
public void CannotLightMiddleTest() throws InvalidFileFormatException {
TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLight", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
transition.setRule(RULE);

LightUpBoard board = (LightUpBoard) transition.getBoard();
//confirm there is a contradiction somewhere on the board
Expand All @@ -68,24 +68,4 @@ public void CannotLightMiddleTest() throws InvalidFileFormatException {
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 2)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(2, 1)));
}

@Test
public void CanLightTest() throws InvalidFileFormatException {
TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/CanLightTest", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);

LightUpBoard board = (LightUpBoard) transition.getBoard();
//confirm there is not a contradiction somewhere on the board
Assert.assertNotNull(RULE.checkContradiction(board));

//confirm that these cells can be lit, are already lit, or that they are just black blocks
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 3)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(3, 3)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 0)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(3, 2)));
}
}

This file was deleted.

This file was deleted.

0 comments on commit 9eb5075

Please sign in to comment.