Skip to content
Snippets Groups Projects
Commit c03fdfc1 authored by Saurav Saurav's avatar Saurav Saurav
Browse files

add working test cases

parent faff0a01
No related branches found
No related tags found
No related merge requests found
Pipeline #1515 canceled
......@@ -27,5 +27,33 @@ public class DotsAndBoxesGridTest {
assertTrue(true);
}
// FIXME: You need to write tests for the two known bugs in the code.
/*
* Tests are functions that have an @Test annotation before them.
* The typical format of a test is that it contains some code that does something, and then one
* or more assertions to check that a condition holds.
*
* This is a dummy test just to show that the test suite itself runs
*/
@Test
public void ifSquareIsComplete() {
DotsAndBoxesGrid grid = new DotsAndBoxesGrid(15, 8, 2);
grid.drawHorizontal(2,2,1);
grid.drawVertical(2,2,1)
assertTrue(grid.boxComplete(2,2));
}
/*
* Tests are functions that have an @Test annotation before them.
* The typical format of a test is that it contains some code that does something, and then one
* or more assertions to check that a condition holds.
*
* This is a dummy test just to show that the test suite itself runs
*/
@Test
public void drawLineOnlyIfMissing() {
DotsAndBoxesGrid grid = new DotsAndBoxesGrid(15, 8, 2);
grid.drawHorizontal(2,2,1);
assertTrue(!grid.drawHorizontal(2,2,1));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment