Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • bmcandre/assessment2
1 result
Select Git revision
Loading items
Show changes

Commits on Source 2

......@@ -27,5 +27,30 @@ public class DotsAndBoxesGridTest {
assertTrue(true);
}
// FIXME: You need to write tests for the two known bugs in the code.
@Test
public void boxCompleteDetectsCompletedBoxes() {
// A grid where we're going to draw a box, and then test whether it's complete
DotsAndBoxesGrid case1 = new DotsAndBoxesGrid(5, 5, 2);
case1.drawHorizontal(0, 0, 0);
case1.drawVertical(0, 0, 1);
case1.drawHorizontal(0, 1, 0);
case1.drawVertical(1, 0, 1);
assertTrue(case1.boxComplete(0, 0));
assertTrue(case1.boxComplete(1, 1));
assertTrue(case1.getHorizontal(0, 0)&&case1.getVertical(0, 0));
assertTrue(case1.getHorizontal(1, 0)&&case1.getVertical(1, 0));
}
@Test
public void drawHorizontalTest() {
DotsAndBoxesGrid case1 = new DotsAndBoxesGrid(5, 5, 2);
case1.drawHorizontal(0, 0, 0);
case1.drawVertical(0, 0, 1);
case1.drawHorizontal(0, 1, 0);
case1.drawVertical(1, 0, 1);
assertThrows(RuntimeException.class, () -> {case1.drawHorizontal(0, 0, 0);});
}
}