Minor: New Game Yu-Gi-Oh! Bandai (#22)

This commit is contained in:
Sebastian Dine
2026-07-30 14:51:53 +02:00
committed by GitHub
parent 7cf25d671f
commit 2eb7c59f78
65 changed files with 4142 additions and 75 deletions
+46
View File
@@ -10,6 +10,7 @@
#include "ccm/domain/JapanesePokemonCard.hpp"
#include "ccm/domain/MagicCard.hpp"
#include "ccm/domain/PokemonCard.hpp"
#include "ccm/domain/YuGiOhBandaiCard.hpp"
#include "ccm/domain/YuGiOhCard.hpp"
#include "ccm/domain/Set.hpp"
#include "ccm/services/CardSorter.hpp"
@@ -548,6 +549,51 @@ TEST_SUITE("CardSorter - DigiBattle99 columns") {
}
}
TEST_SUITE("CardSorter - YuGiOhBandai columns") {
TEST_CASE("Holo sorts false before true; Rarity and SetNo sort") {
YuGiOhBandaiCard a;
a.id = 1;
a.name = "a";
a.set = Set{"ban1", "1st Generation", "1998/09/01"};
a.setNo = "14";
a.rarity = "Rare";
a.holo = true;
YuGiOhBandaiCard b;
b.id = 2;
b.name = "b";
b.set = Set{"ban1", "1st Generation", "1998/09/01"};
b.setNo = "9";
b.rarity = "Common";
b.holo = false;
std::vector<YuGiOhBandaiCard> v = {a, b};
sortYuGiOhBandaiCards(v, YuGiOhBandaiSortColumn::Holo, /*ascending=*/true);
CHECK(v[0].id == 2);
CHECK(v[1].id == 1);
sortYuGiOhBandaiCards(v, YuGiOhBandaiSortColumn::SetNo, /*ascending=*/true);
CHECK(v[0].setNo == "14");
CHECK(v[1].setNo == "9");
sortYuGiOhBandaiCards(v, YuGiOhBandaiSortColumn::Rarity, /*ascending=*/true);
CHECK(v[0].rarity == "Common");
}
TEST_CASE("Set column sorts by release date") {
YuGiOhBandaiCard a;
a.id = 1;
a.set = Set{"ban3", "3rd Generation", "1999/03/06"};
YuGiOhBandaiCard b;
b.id = 2;
b.set = Set{"ban1", "1st Generation", "1998/09/01"};
std::vector<YuGiOhBandaiCard> v = {a, b};
sortYuGiOhBandaiCards(v, YuGiOhBandaiSortColumn::SetReleaseDate, /*ascending=*/true);
CHECK(v[0].id == 2);
CHECK(v[1].id == 1);
}
}
TEST_SUITE("CardSorter - JapanesePokemon columns") {
TEST_CASE("Holo and FirstEdition sort false before true") {
std::vector<JapanesePokemonCard> v = {