Skip to content

Commit

Permalink
add DefaultReportPageFactory tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vananiev committed Apr 22, 2024
1 parent 36d7b8c commit e074111
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,22 @@ void create_namedSheetForCsvByInputStream_ok(String fileName) {
assertNotNull(factory.create(is, "SheetB"));
}

// Test unexpected type sheet id

@ParameterizedTest
@ValueSource(strings = {"test.xls", "test.xlsx", "test.xml", "test.txt", "test.bin"})
void create_unknownTypeSheetId_exception(String fileName) {
Path path = getPath(fileName);
assertThrows(ReportPageInstantiationException.class, () -> factory.doCreate(path, new Object()));
}

@ParameterizedTest
@ValueSource(strings = {"test.csv"})
void create_csvWithUnknownTypeSheetId_ok(String fileName) {
Path path = getPath(fileName);
assertNotNull(factory.doCreate(path, new Object()));
}

// test InputStream closing

@Test
Expand Down

0 comments on commit e074111

Please sign in to comment.