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.

20 lines
699 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.CsvFileSource;
  6. import de.edu.hsfulda.ccip.tdd.purefunction.BowlingCalculator;
  7. public class BowlingCalculatorParameterized_3_CsvFileTest {
  8. @ParameterizedTest(name = "#{index} - game type {0}")
  9. @CsvFileSource(resources = "/gameSamples.csv",numLinesToSkip = 1)
  10. void testStreamSouceMulti(String gameType, String rolls, int expectedResult) {
  11. int score = new BowlingCalculator().score(rolls);
  12. assertThat(rolls, score, CoreMatchers.equalTo(expectedResult));
  13. }
  14. }