Took 15 minutes
This commit is contained in:
Lukas Brübach 2025-09-25 23:37:28 +02:00
parent 6881f95c7f
commit 4d6b0f1489
2 changed files with 7 additions and 7 deletions

View file

@ -13,21 +13,21 @@ TEST(CardDatabaseTest, LoadXml)
// ensure the card database is empty at start // ensure the card database is empty at start
ASSERT_EQ(0, db->getCardList().size()) << "Cards not 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->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"; ASSERT_EQ(NotLoaded, db->getLoadStatus()) << "Incorrect status at start";
// load dummy cards and test result // load dummy cards and test result
db->loadCardDatabases(); db->loadCardDatabases();
ASSERT_EQ(9, db->getCardList().size()) << "Wrong card count after load"; ASSERT_EQ(9, db->getCardList().size()) << "Wrong card count after load";
ASSERT_EQ(5, db->getSetList().size()) << "Wrong sets 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"; ASSERT_EQ(Ok, db->getLoadStatus()) << "Wrong status after load";
// ensure the card database is empty after clear() // ensure the card database is empty after clear()
db->clear(); db->clear();
ASSERT_EQ(0, db->getCardList().size()) << "Cards not empty after 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->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"; ASSERT_EQ(NotLoaded, db->getLoadStatus()) << "Incorrect status after clear";
} }
} // namespace } // namespace

View file

@ -18,10 +18,10 @@ class CardQuery : public ::testing::Test
protected: protected:
void SetUp() override void SetUp() override
{ {
cat = CardDatabaseManager::getInstance()->getCardBySimpleName("Cat"); cat = CardDatabaseManager::query()->getCardBySimpleName("Cat");
notDeadAfterAll = CardDatabaseManager::getInstance()->getCardBySimpleName("Not Dead"); notDeadAfterAll = CardDatabaseManager::query()->getCardBySimpleName("Not Dead");
truth = CardDatabaseManager::getInstance()->getCardBySimpleName("Truth"); truth = CardDatabaseManager::query()->getCardBySimpleName("Truth");
doctor = CardDatabaseManager::getInstance()->getCardBySimpleName("Doctor"); doctor = CardDatabaseManager::query()->getCardBySimpleName("Doctor");
} }
// void TearDown() override {} // void TearDown() override {}