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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
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 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() {
return new TestSuite(BadmintonScoringWithStrokeTest.class);
}
public void test_getMostUsedStrokePlayer1() {
assertEquals("smash", subject.getMostUsedStrokePlayer1());
}
public void test_getMostUsedStrokePlayer2() {
assertEquals("net-shot", subject.getMostUsedStrokePlayer2());
}
public void test_getPlayer1Points() {
assertEquals(5, this.subject.getPlayer1Points());
}
public void test_getPlayer2Points() {
assertEquals(21, this.subject.getPlayer2Points());
}
public void test_getContinuousPointsPlayer1() {
assertEquals(2, this.subject.getContinuousPointsPlayer1());
}
public void test_getContinuousPointsPlayer2() {
assertEquals(9, this.subject.getContinuousPointsPlayer2());
}
}
|