master
 1package ca.mokhan.test;
 2
 3import Q8.*;
 4import java.io.*;
 5import java.text.*;
 6import java.util.*;
 7import junit.framework.Test;
 8import junit.framework.TestCase;
 9import junit.framework.TestSuite;
10
11public class BadmintonScoringTest extends TestCase {
12  private BadmintonScoring subject;
13  private int[][] scores = {
14    {0, 0},
15    {1, 0},
16    {2, 0},
17    {2, 1},
18    {2, 2},
19    {2, 3},
20    {2, 4},
21    {2, 5},
22    {3, 5},
23    {4, 5},
24    {4, 6},
25    {4, 7},
26    {4, 8},
27    {4, 9},
28    {4, 10},
29    {4, 11},
30    {4, 12},
31    {4, 13},
32    {4, 14},
33    {4, 15},
34    {5, 15},
35    {5, 16},
36    {5, 17},
37    {5, 18},
38    {5, 19},
39    {5, 20},
40    {5, 21},
41  };
42
43  public BadmintonScoringTest(String testName) {
44    super(testName);
45    this.subject = new BadmintonScoring(this.scores);
46  }
47
48  public static Test suite() {
49    return new TestSuite(BadmintonScoringTest.class);
50  }
51
52  public void test_getPlayer1Points() {
53    assertEquals(5, this.subject.getPlayer1Points());
54  }
55
56  public void test_getPlayer2Points() {
57    assertEquals(21, this.subject.getPlayer2Points());
58  }
59
60  public void test_getContinuousPointsPlayer1() {
61    assertEquals(2, this.subject.getContinuousPointsPlayer1());
62  }
63
64  public void test_getContinuousPointsPlayer2() {
65    assertEquals(9, this.subject.getContinuousPointsPlayer2());
66  }
67}