mirror of
https://github.com/kiwix/java-libkiwix.git
synced 2025-09-08 06:38:41 -04:00
Added test cases for checking is archive created with invalid zim file , added remove book from library by id tests
This commit is contained in:
parent
bea92d800d
commit
d6e4479621
@ -71,6 +71,15 @@ public class test {
|
||||
assertEquals(new String(faviconData), c);
|
||||
|
||||
archive.dispose();
|
||||
|
||||
// test reader with invalid zim file
|
||||
String zimFile = "test.zim";
|
||||
try {
|
||||
Archive archive1 = new Archive(zimFile);
|
||||
fail("ERROR: Archive created with invalid Zim file!");
|
||||
} catch (ZimFileFormatException zimFileFormatException) {
|
||||
assertEquals("Cannot open zimfile " + zimFile, zimFileFormatException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -145,6 +154,11 @@ public class test {
|
||||
String[] bookIds = lib.getBooksIds();
|
||||
assertEquals(bookIds.length, 1);
|
||||
lib.filter(new Filter().local(true));
|
||||
|
||||
// remove book from library by id
|
||||
lib.removeBookById(bookIds[0]);
|
||||
bookIds = lib.getBooksIds();
|
||||
assertEquals(bookIds.length, 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user