-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathApplicationTest.java
More file actions
36 lines (27 loc) · 1.05 KB
/
ApplicationTest.java
File metadata and controls
36 lines (27 loc) · 1.05 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
package baseball;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import baseball.model.BaseballGame;
import baseball.model.BaseballNumber;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class ApplicationTest {
@Test
public void 랜덤_숫자_생성_함수는_1부터_9까지의_숫자_3개를_생성한다() {
BaseballGame baseballGame = new BaseballGame();
baseballGame.createTargetNumber(1,9);
BaseballNumber[] numbers = baseballGame.getTargetNumbers();
assertThat(numbers.length).isEqualTo(3);
for (BaseballNumber number : numbers) {
assertThat(number.getValue()).isBetween(1, 9);
}
// long distinctCount = numbers.stream().distinct().count();
// assertThat(distinctCount).isEqualTo(3);
}
}