diff --git a/src/test/java/dotsandboxes/DotsAndBoxesGridTest.java b/src/test/java/dotsandboxes/DotsAndBoxesGridTest.java index 1946beda974d180686c65c0259a7b881e9a4eb5a..9a1ece826581895b90f250223c08f3c0f933d019 100644 --- a/src/test/java/dotsandboxes/DotsAndBoxesGridTest.java +++ b/src/test/java/dotsandboxes/DotsAndBoxesGridTest.java @@ -28,4 +28,14 @@ public class DotsAndBoxesGridTest { } // FIXME: You need to write tests for the two known bugs in the code. + /** this tests whether drawing just a horitonal line at coordinate (0,0) + * completes a box at coordinate (0,0) or not. + * The game shouldn't complete a box and return false. */ + @DisplayName("Just horizontal line at [0][0], complete a box at [0][0]") + @Test + public void testBoxComplete() { + DotsAndBoxesGrid grid = new DotsAndBoxesGrid(4, 3, 2); + grid.drawHorizontal(0, 0, 1); + assertEquals(false, grid.boxComplete(0, 0)); + } }