|
|
@ -7,9 +7,6 @@ import org.junit.jupiter.params.provider.Arguments; |
|
|
|
import org.junit.jupiter.params.provider.MethodSource; |
|
|
|
|
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Collection; |
|
|
@ -180,11 +177,8 @@ public class PlayerTest { |
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("checkChooseMethodData") |
|
|
|
void checkChoose(String testName, String input, int expectedResult) { |
|
|
|
InputStream stdin = System.in; |
|
|
|
System.setIn(new ByteArrayInputStream(input.getBytes())); |
|
|
|
|
|
|
|
int calculatedResult = p.choose(); |
|
|
|
|
|
|
|
assertThat(calculatedResult).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|