You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
763 B

4 years ago
  1. package de.edu.hsfulda.ccip.tdd.purefunction.parameterized;
  2. import static org.junit.Assert.assertThat;
  3. import org.hamcrest.CoreMatchers;
  4. import org.junit.jupiter.params.ParameterizedTest;
  5. import org.junit.jupiter.params.provider.CsvSource;
  6. import de.edu.hsfulda.ccip.tdd.purefunction.BowlingCalculator;
  7. public class BowlingCalculatorParameterized_2_CsvTest {
  8. @CsvSource({ //
  9. "worst game , -- -- -- -- -- -- -- -- -- --, 0",
  10. "incomplete frames, -1 23 -4 5- -6 -7 8- 9- -- --, 45" //
  11. })
  12. @ParameterizedTest(name = "#{index} - game type {0}")
  13. void testStreamSouceMulti(String gameType, String rolls, int expectedResult) {
  14. int score = new BowlingCalculator().score(rolls);
  15. assertThat(rolls, score, CoreMatchers.equalTo(expectedResult));
  16. }
  17. }