Skip to content
Snippets Groups Projects
Commit 02798088 authored by Carla Baldassara's avatar Carla Baldassara
Browse files

Do not fix the bugs in the commit. The units tests should fail.

parent 29858cb3
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ package dotsandboxes;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assumptions.*;
import org.apache.logging.log4j.LogManager;
......@@ -28,4 +29,30 @@ public class DotsAndBoxesGridTest {
}
// FIXME: You need to write tests for the two known bugs in the code.
@Test
public void testBoxComplete() {
logger.info("testing whether the box is complete is wrong");
int x = 1;
int y = 1;
int p = 1;
DotsAndBoxesGrid z = new DotsAndBoxesGrid(x, y, p);
assertTrue(z.boxComplete(x, y));
}
@Test
public void testExistingLine (){
logger.info("testing exception is thrown when line exists");
int x = 1;
int y = 1;
int p = 1;
DotsAndBoxesGrid z = new DotsAndBoxesGrid(x, y, p);
z.getHorizontal(x, y);
assertThrows(IllegalStateException.class, () -> z.drawHorizontal(x, y, p), "The line exists");
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment