mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Helper function Library::getBookPropValueSet()
Introduced a helper function `Library::getBookPropValueSet()` and deduplicated Library::getBooks{Languages,Creators,Publishers}() methods.
This commit is contained in:
committed by
Matthieu Gautier
parent
b2027b397c
commit
18871b4b15
@ -275,9 +275,25 @@ TEST_F(LibraryTest, getBookMarksTest)
|
||||
TEST_F(LibraryTest, sanityCheck)
|
||||
{
|
||||
EXPECT_EQ(lib.getBookCount(true, true), 12U);
|
||||
EXPECT_EQ(lib.getBooksLanguages().size(), 3U);
|
||||
EXPECT_EQ(lib.getBooksCreators().size(), 9U);
|
||||
EXPECT_EQ(lib.getBooksPublishers().size(), 3U);
|
||||
EXPECT_EQ(lib.getBooksLanguages(),
|
||||
std::vector<std::string>({"deu", "eng", "fra"})
|
||||
);
|
||||
EXPECT_EQ(lib.getBooksCreators(), std::vector<std::string>({
|
||||
"Islam Stack Exchange",
|
||||
"Movies & TV Stack Exchange",
|
||||
"Mythology & Folklore Stack Exchange",
|
||||
"TED",
|
||||
"Tania Louis",
|
||||
"Wiki",
|
||||
"Wikibooks",
|
||||
"Wikipedia",
|
||||
"Wikiquote"
|
||||
}));
|
||||
EXPECT_EQ(lib.getBooksPublishers(), std::vector<std::string>({
|
||||
"",
|
||||
"Kiwix",
|
||||
"Kiwix & Some Enthusiasts"
|
||||
}));
|
||||
}
|
||||
|
||||
TEST_F(LibraryTest, categoryHandling)
|
||||
|
Reference in New Issue
Block a user