|
|
@ -6,6 +6,10 @@ import org.junit.jupiter.params.ParameterizedTest; |
|
|
|
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; |
|
|
@ -172,4 +176,18 @@ public class PlayerTest { |
|
|
|
false) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void checkChooseMethod() { |
|
|
|
|
|
|
|
InputStream stdin = System.in; |
|
|
|
System.setIn(new ByteArrayInputStream("0\n".getBytes())); |
|
|
|
|
|
|
|
int calculatedResult = p.choose(); |
|
|
|
|
|
|
|
System.setIn(stdin); |
|
|
|
|
|
|
|
int expectedResult = 0; |
|
|
|
assertThat(calculatedResult).describedAs("Choose one Figure").isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
} |