Skip to content
Snippets Groups Projects
Commit b03e4d81 authored by Brendan Raines's avatar Brendan Raines
Browse files

Unit tests added to test errors in the code.

parent fe52907d
No related branches found
No related merge requests found
......@@ -27,5 +27,26 @@ public class DotsAndBoxesGridTest {
assertTrue(true);
}
@Test
public void testGridComplete()
{
DotsAndBoxesGrid testGrid = new DotsAndBoxesGrid(5,5,1);
testGrid.drawHorizontal(1,1,1);
testGrid.drawHorizontal(1,2,1);
testGrid.drawVertical(1,1,1);
assertFalse(testGrid.boxComplete(1,1),"Box is not Complete");
}
@Test
public void testLineDrawn()
{
DotsAndBoxesGrid testGrid2 = new DotsAndBoxesGrid(5,5,1);
testGrid2.drawVertical(1,1,1);
assertThrows(IllegalArgumentException.class, () ->testGrid2.drawVertical(1,1,1), "Line already Drawn");
}
// FIXME: You need to write tests for the two known bugs in the code.
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment