Stop mocking and start injecting for tests.

Took 15 minutes
This commit is contained in:
Lukas Brübach 2025-11-06 22:33:56 +01:00
parent 0d2b498e55
commit df710dd104
6 changed files with 39 additions and 464 deletions

View file

@ -1,13 +1,18 @@
#include "mocks.h"
#include "test_card_database_path_provider.h"
#include "gtest/gtest.h"
#include <libcockatrice/interfaces/noop_card_preference_provider.h>
#include <libcockatrice/interfaces/noop_card_set_priority_controller.h>
namespace
{
TEST(CardDatabaseTest, LoadXml)
{
CardDatabase *db = new CardDatabase;
CardDatabase *db = new CardDatabase(nullptr, QSharedPointer<NoopCardPreferenceProvider>::create(),
QSharedPointer<TestCardDatabasePathProvider>::create(),
QSharedPointer<NoopCardSetPriorityController>::create());
// ensure the card database is empty at start
ASSERT_EQ(0, db->getCardList().size()) << "Cards not empty at start";