forked from woowacourse-precourse/java-baseball-6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputNumberGeneratorTest.java
More file actions
27 lines (22 loc) · 1.02 KB
/
InputNumberGeneratorTest.java
File metadata and controls
27 lines (22 loc) · 1.02 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
package baseball.domain;
import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
class InputNumberGeneratorTest {
@ParameterizedTest
@DisplayName("입력으로 들어온 문자열을 리스트 형태로 반환한다.")
@ValueSource(strings = {"123", "456", "789"})
void inputThreeDigit(String input) throws Exception {
List<Integer> threeDigitNumber = InputNumberGenerator.generate(input);
Assertions.assertAll(
() -> Assertions.assertEquals(
Character.getNumericValue(input.charAt(0)), threeDigitNumber.get(0)),
() -> Assertions.assertEquals(
Character.getNumericValue(input.charAt(1)), threeDigitNumber.get(1)),
() -> Assertions.assertEquals(
Character.getNumericValue(input.charAt(2)), threeDigitNumber.get(2))
);
}
}