|
@ -0,0 +1,20 @@ |
|
|
|
|
|
package de.edu.hsfulda.ccip.tdd.purefunction.parameterized; |
|
|
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertThat; |
|
|
|
|
|
|
|
|
|
|
|
import org.hamcrest.CoreMatchers; |
|
|
|
|
|
import org.junit.jupiter.params.ParameterizedTest; |
|
|
|
|
|
import org.junit.jupiter.params.provider.CsvFileSource; |
|
|
|
|
|
|
|
|
|
|
|
import de.edu.hsfulda.ccip.tdd.purefunction.BowlingCalculator; |
|
|
|
|
|
|
|
|
|
|
|
public class BowlingCalculatorParameterized_3_CsvFileTest { |
|
|
|
|
|
|
|
|
|
|
|
@ParameterizedTest(name = "#{index} - game type {0}") |
|
|
|
|
|
@CsvFileSource(resources = "/gameSamples.csv",numLinesToSkip = 1) |
|
|
|
|
|
void testStreamSouceMulti(String gameType, String rolls, int expectedResult) { |
|
|
|
|
|
int score = new BowlingCalculator().score(rolls); |
|
|
|
|
|
assertThat(rolls, score, CoreMatchers.equalTo(expectedResult)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |