Commit 3068f5da authored by nreeves5's avatar nreeves5
Browse files

Committing with unit tests for box completion and line already drawn, both fail.

parent 196de253
......@@ -3,6 +3,7 @@ package dotsandboxes;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assumptions.*;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -28,4 +29,31 @@ public class DotsAndBoxesGridTest {
// FIXME: You need to write tests for the two known bugs in the code.
public void testTestingBoxComplete() {"Test of box completion test");"Drawing complete box, then asserting incomplete state");
DotsAndBoxesGrid g = new DotsAndBoxesGrid(4,4,1);
g.drawHorizontal(1,1, 1);
public void testTestingLineDrawn() {"Test of line already drawn detection");"Instantiating new grid");
DotsAndBoxesGrid h = new DotsAndBoxesGrid(4,4,1);"Drawing a line to later be duplicated");
h.drawHorizontal(1,1,1);"Drawing line a second time within an assert throws block, expecting and illegal state exception");
IllegalStateException thrown = assertThrows(
IllegalStateException.class, () -> h.drawHorizontal (1,1,1),
"Drawing second horizontal line should have thrown illegal state exception, did not"
\ No newline at end of file
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