mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
Tests.
Took 15 minutes
This commit is contained in:
parent
6881f95c7f
commit
4d6b0f1489
2 changed files with 7 additions and 7 deletions
|
|
@ -13,21 +13,21 @@ TEST(CardDatabaseTest, LoadXml)
|
|||
// ensure the card database is empty at start
|
||||
ASSERT_EQ(0, db->getCardList().size()) << "Cards not empty at start";
|
||||
ASSERT_EQ(0, db->getSetList().size()) << "Sets not empty at start";
|
||||
ASSERT_EQ(0, db->getAllMainCardTypes().size()) << "Types not empty at start";
|
||||
ASSERT_EQ(0, db->query()->getAllMainCardTypes().size()) << "Types not empty at start";
|
||||
ASSERT_EQ(NotLoaded, db->getLoadStatus()) << "Incorrect status at start";
|
||||
|
||||
// load dummy cards and test result
|
||||
db->loadCardDatabases();
|
||||
ASSERT_EQ(9, db->getCardList().size()) << "Wrong card count after load";
|
||||
ASSERT_EQ(5, db->getSetList().size()) << "Wrong sets count after load";
|
||||
ASSERT_EQ(3, db->getAllMainCardTypes().size()) << "Wrong types count after load";
|
||||
ASSERT_EQ(3, db->query()->getAllMainCardTypes().size()) << "Wrong types count after load";
|
||||
ASSERT_EQ(Ok, db->getLoadStatus()) << "Wrong status after load";
|
||||
|
||||
// ensure the card database is empty after clear()
|
||||
db->clear();
|
||||
ASSERT_EQ(0, db->getCardList().size()) << "Cards not empty after clear";
|
||||
ASSERT_EQ(0, db->getSetList().size()) << "Sets not empty after clear";
|
||||
ASSERT_EQ(0, db->getAllMainCardTypes().size()) << "Types not empty after clear";
|
||||
ASSERT_EQ(0, db->query()->getAllMainCardTypes().size()) << "Types not empty after clear";
|
||||
ASSERT_EQ(NotLoaded, db->getLoadStatus()) << "Incorrect status after clear";
|
||||
}
|
||||
} // namespace
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ class CardQuery : public ::testing::Test
|
|||
protected:
|
||||
void SetUp() override
|
||||
{
|
||||
cat = CardDatabaseManager::getInstance()->getCardBySimpleName("Cat");
|
||||
notDeadAfterAll = CardDatabaseManager::getInstance()->getCardBySimpleName("Not Dead");
|
||||
truth = CardDatabaseManager::getInstance()->getCardBySimpleName("Truth");
|
||||
doctor = CardDatabaseManager::getInstance()->getCardBySimpleName("Doctor");
|
||||
cat = CardDatabaseManager::query()->getCardBySimpleName("Cat");
|
||||
notDeadAfterAll = CardDatabaseManager::query()->getCardBySimpleName("Not Dead");
|
||||
truth = CardDatabaseManager::query()->getCardBySimpleName("Truth");
|
||||
doctor = CardDatabaseManager::query()->getCardBySimpleName("Doctor");
|
||||
}
|
||||
// void TearDown() override {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue