Commit 7823a4d7 authored by Qi LI's avatar Qi LI
Browse files

test the end of a game

parent 570741b4
......@@ -134,4 +134,21 @@ public class TestScoreTable {
Assert.assertArrayEquals(expected, actual);
}
@Test
public void testCase9() {
ScoreTable table = new ScoreTable();
int[] points = {10,10,10,10,10,10,10,10,10,8,2,9};
boolean[] expected = new boolean[points.length];
boolean[] actual = new boolean[points.length];
for (int i = 0; i < points.length; ++i) {
table.enterPoint(points[i]);
expected[i] = false;
actual[i] = table.isComplete();
}
expected[expected.length - 1] = true;
Assert.assertArrayEquals(expected, actual);
}
}
Markdown is supported
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