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