diff options
| author | mo khan <mo@mokhan.ca> | 2019-08-04 15:43:43 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2019-08-04 15:43:43 -0600 |
| commit | 7f13704a29228435ef6250b36f7fc277b8354c62 (patch) | |
| tree | b7edb00dcad7ac94beb12a30ebb383045ece6cbe /src/Q8/BadmintonScoringWithStrokeTest.java | |
| parent | 37f2196d2b140198bf0b6dd631529efd8b4cacd7 (diff) | |
get max stroke used for each player
Diffstat (limited to 'src/Q8/BadmintonScoringWithStrokeTest.java')
| -rw-r--r-- | src/Q8/BadmintonScoringWithStrokeTest.java | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/src/Q8/BadmintonScoringWithStrokeTest.java b/src/Q8/BadmintonScoringWithStrokeTest.java index 5086721..59e41fe 100644 --- a/src/Q8/BadmintonScoringWithStrokeTest.java +++ b/src/Q8/BadmintonScoringWithStrokeTest.java @@ -9,8 +9,42 @@ import junit.framework.TestCase; import junit.framework.TestSuite; public class BadmintonScoringWithStrokeTest extends TestCase { + private BadmintonScoringWithStroke subject; + private ArrayList<Point> points = + new ArrayList<Point>() { + { + add(new Point(Point.PLAYER1, "a", 1)); + add(new Point(Point.PLAYER1, "c", 2)); + add(new Point(Point.PLAYER2, "d", 1)); + add(new Point(Point.PLAYER2, "e", 2)); + add(new Point(Point.PLAYER2, "d", 3)); + add(new Point(Point.PLAYER2, "e", 4)); + add(new Point(Point.PLAYER2, "d", 5)); + add(new Point(Point.PLAYER1, "a", 3)); + add(new Point(Point.PLAYER1, "c", 4)); + add(new Point(Point.PLAYER2, "e", 6)); + add(new Point(Point.PLAYER2, "e", 7)); + add(new Point(Point.PLAYER2, "a", 8)); + add(new Point(Point.PLAYER2, "d", 9)); + add(new Point(Point.PLAYER2, "e", 10)); + add(new Point(Point.PLAYER2, "e", 11)); + add(new Point(Point.PLAYER2, "e", 12)); + add(new Point(Point.PLAYER2, "e", 13)); + add(new Point(Point.PLAYER2, "e", 14)); + add(new Point(Point.PLAYER2, "e", 15)); + add(new Point(Point.PLAYER1, "c", 5)); + add(new Point(Point.PLAYER2, "e", 16)); + add(new Point(Point.PLAYER2, "e", 17)); + add(new Point(Point.PLAYER2, "e", 18)); + add(new Point(Point.PLAYER2, "e", 19)); + add(new Point(Point.PLAYER2, "e", 20)); + add(new Point(Point.PLAYER2, "e", 21)); + } + }; + public BadmintonScoringWithStrokeTest(String testName) { super(testName); + this.subject = new BadmintonScoringWithStroke(this.points); } public static Test suite() { @@ -18,6 +52,10 @@ public class BadmintonScoringWithStrokeTest extends TestCase { } public void test_getMostUsedStrokePlayer1() { - assertTrue(true); + assertEquals("smash", subject.getMostUsedStrokePlayer1()); + } + + public void test_getMostUsedStrokePlayer2() { + assertEquals("net-shot", subject.getMostUsedStrokePlayer2()); } } |
