Repository navigation
Expand file tree
/
Copy pathNormalFrameTest.java
More file actions
92 lines (72 loc) · 2.09 KB
/
Copy pathNormalFrameTest.java
File metadata and controls
92 lines (72 loc) · 2.09 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package domain;
import domain.frame.Frame;
import domain.frame.NormalFrame;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.*;
import static org.junit.Assert.assertThat;
public class NormalFrameTest {
private Frame frame;
@Before
public void setUp() {
frame = new NormalFrame();
}
@Test
public void 프레임_10_스트라이크() {
frame.roll(new BowlPin(10));
프레임_결과_조회(10, true, "X");
}
@Test
public void 프레임_0_거터() {
frame.roll(new BowlPin(0));
프레임_결과_조회(0, false, "-");
}
@Test
public void 프레임_0_0_거터() {
frame.roll(new BowlPin(0));
프레임_결과_조회(0, false, "-");
frame.roll(new BowlPin(0));
프레임_결과_조회(0, true, "-|-");
}
@Test
public void 프레임_0_10_스패어() {
frame.roll(new BowlPin(0));
프레임_결과_조회(0, false, "-");
frame.roll(new BowlPin(10));
프레임_결과_조회(10, true, "-|/");
}
@Test
public void 프레임_0_거터_8_미스() {
frame.roll(new BowlPin(0));
프레임_결과_조회(0, false, "-");
frame.roll(new BowlPin(8));
프레임_결과_조회(8, true, "-|8");
}
@Test
public void 프레임_5_0_거터() {
frame.roll(new BowlPin(5));
프레임_결과_조회(5, false, "5");
frame.roll(new BowlPin(0));
프레임_결과_조회(5, true, "5|-");
}
@Test
public void 프레임_7_2_미스() {
frame.roll(new BowlPin(7));
프레임_결과_조회(7, false, "7");
frame.roll(new BowlPin(2));
프레임_결과_조회(9, true, "7|2");
}
@Test
public void 프레임_3_7_스페어() {
frame.roll(new BowlPin(3));
프레임_결과_조회(3, false, "3");
frame.roll(new BowlPin(7));
프레임_결과_조회(10, true, "3|/");
}
private void 프레임_결과_조회(int score, boolean frameEnd, String result) {
assertThat(frame.getScore(), equalTo(score));
assertThat(frame.isFrameEnd(), equalTo(frameEnd));
assertThat(frame.getResult(), equalTo(result));
}
}