Skip to content
Snippets Groups Projects
Commit f8b3d7e7 authored by Anudip Chauhan's avatar Anudip Chauhan
Browse files

add unit test

parent 8490b8df
Branches
No related tags found
No related merge requests found
...@@ -32,13 +32,13 @@ public class DotsAndBoxesGridTest { ...@@ -32,13 +32,13 @@ public class DotsAndBoxesGridTest {
public void testBoxCompletionDetection() { public void testBoxCompletionDetection() {
DotsAndBoxesGrid grid = new DotsAndBoxesGrid(4, 3, 2); DotsAndBoxesGrid grid = new DotsAndBoxesGrid(4, 3, 2);
// Draw only three sides of a box (not completing it) // Draw four sides of a box (not completing it)
grid.drawHorizontal(0, 0, 1); // Top grid.drawHorizontal(0, 0, 1); // Top
grid.drawVertical(0, 0, 1); // Left grid.drawVertical(0, 0, 1); // Left
grid.drawHorizontal(0, 1, 1); // Bottom grid.drawHorizontal(0, 1, 1); // Bottom
grid.drawVertical(1,0,1); //Right
// Check if the box at (0, 0) is incorrectly identified as completed assertTrue(grid.boxComplete(0, 0), "The box should be completed.");
assertTrue(grid.boxComplete(0, 0), "The box should not be completed.");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment