2020-07-04 15:18:24 +00:00
|
|
|
#ifdef TESTS_BUILD
|
2022-02-05 12:59:15 +00:00
|
|
|
#include <doctest.h>
|
2020-07-04 15:18:24 +00:00
|
|
|
#include "../../src/Library/BaseLibrary.hpp"
|
|
|
|
#include "../TestLibrary/TestLibrary.hpp"
|
|
|
|
|
|
|
|
using namespace CreatureLib::Library;
|
2020-09-25 10:43:08 +00:00
|
|
|
TEST_CASE("Iterate over library") {
|
2020-07-04 15:18:24 +00:00
|
|
|
auto& lib = TestLibrary::Get()->GetSpeciesLibrary();
|
|
|
|
auto i = 0;
|
2022-05-16 15:21:39 +00:00
|
|
|
for (auto& b : *lib) {
|
2020-07-04 15:18:24 +00:00
|
|
|
if (i == 0) {
|
|
|
|
CHECK(b.second->GetName() == "testSpecies1"_cnc);
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
CHECK(i == 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|