Commit 70984618 authored by Chandana Maturi's avatar Chandana Maturi
Browse files

unit testing failed

parent 18a0a268
Pipeline #1609 failed with stages
in 0 seconds
...@@ -28,4 +28,31 @@ public class DotsAndBoxesGridTest { ...@@ -28,4 +28,31 @@ public class DotsAndBoxesGridTest {
} }
// FIXME: You need to write tests for the two known bugs in the code. // FIXME: You need to write tests for the two known bugs in the code.
@Test
public void checkforBoxComplete() {
logger.info("Check wheather the box is complete is wrong or not");
int x = 1;
int y = 1;
int p = 1;
DotsAndBoxesGrid z = new DotsAndBoxesGrid(x, y, p);
assertFalse(z.boxComplete(x, y));
}
@Test
public void testExistingLine() {
logger.info("testing exception is thrown when line exists");
int x = 2;
int y = 3;
int p = 2;
int w = 12;
int h = 3;
DotsAndBoxesGrid z = new DotsAndBoxesGrid(w, h, p);
z.drawHorizontal(x, y, p);
assertThrows(IllegalStateException.class, () -> z.drawHorizontal(x, y, p), "The line exists");
}
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment