Fix: replace api.pokemontcg.io with api.tcgdex.net (#20)

This commit is contained in:
Sebastian Dine
2026-07-23 17:58:00 +02:00
committed by GitHub
parent 9917e364c1
commit ab0e3c5ae2
27 changed files with 1067 additions and 784 deletions
+18
View File
@@ -236,4 +236,22 @@ TEST_SUITE("CollectionService<MagicCard>") {
CHECK(store.removed[0].second == "a.png");
CHECK(store.removed[1].second == "b.png");
}
TEST_CASE("saveAll replaces the collection map") {
InMemoryRepo repo;
StubImageStore store;
CollectionService<MagicCard> svc{repo, store};
REQUIRE(svc.add(Game::Magic, makeCard("A")).isOk());
REQUIRE(svc.add(Game::Magic, makeCard("B")).isOk());
MagicCard only = makeCard("Only");
only.id = 7;
REQUIRE(svc.saveAll(Game::Magic, {only}).isOk());
auto listed = svc.list(Game::Magic);
REQUIRE(listed.isOk());
REQUIRE(listed.value().size() == 1);
CHECK(listed.value()[0].id == 7);
CHECK(listed.value()[0].name == "Only");
}
}