|
@ -15,7 +15,7 @@ class BordComputerTest { |
|
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
@ParameterizedTest |
|
|
@MethodSource("readConfigOptions") |
|
|
@MethodSource("readConfigOptions") |
|
|
void readConfigTest(String testName, String testTyp, BordComputer testBc) { |
|
|
|
|
|
|
|
|
void readConfigTest(String testName, String testTyp, BordComputer testBc, String expectedResult) { |
|
|
if (testTyp.equals("count")) { |
|
|
if (testTyp.equals("count")) { |
|
|
int count = 0; |
|
|
int count = 0; |
|
|
try (FileReader reader = new FileReader("Geraete.config")) { |
|
|
try (FileReader reader = new FileReader("Geraete.config")) { |
|
@ -27,6 +27,9 @@ class BordComputerTest { |
|
|
} |
|
|
} |
|
|
assertThat(count).describedAs(testName).isEqualTo(testBc.deviceNames.length); |
|
|
assertThat(count).describedAs(testName).isEqualTo(testBc.deviceNames.length); |
|
|
} |
|
|
} |
|
|
|
|
|
if (testTyp.equals("item1")) { |
|
|
|
|
|
assertThat(testBc.deviceNames[0]).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static Stream<Arguments> readConfigOptions() { |
|
|
static Stream<Arguments> readConfigOptions() { |
|
@ -34,7 +37,8 @@ class BordComputerTest { |
|
|
bc1.readConfig(); |
|
|
bc1.readConfig(); |
|
|
|
|
|
|
|
|
return Stream.of( |
|
|
return Stream.of( |
|
|
Arguments.of("Check if file reader is getting every item in Geraete.config", "count", bc1) |
|
|
|
|
|
|
|
|
Arguments.of("Check if file reader is getting every item in Geraete.config", "count", bc1, ""), |
|
|
|
|
|
Arguments.of("Check if file reader is getting the first element", "item1", bc1, "device.cdPlayer.CdPlayer") |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|