ADD: added Identifier class and Identifier Maker and storrage service plus tests
This commit is contained in:
48
tests/test_IdentifierList.cpp
Normal file
48
tests/test_IdentifierList.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#include "SimCore/Identifier.hpp"
|
||||
#include "SimCore/IdentifierMaker.hpp"
|
||||
#include <SimCore/SimCore.hpp>
|
||||
#include <memory>
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
#include <loguru.hpp>
|
||||
|
||||
|
||||
SCENARIO("Testing the SimCorePositionClass")
|
||||
{
|
||||
GIVEN("different position in different forms")
|
||||
{
|
||||
|
||||
SimCore::IdentifierMaker IDList;
|
||||
auto ID1 = IDList.getNewIdentifier(SimCore::EXTERNAL);
|
||||
auto ID2 = IDList.getNewIdentifier(SimCore::EXTERNAL);
|
||||
auto ID3 = IDList.getNewIdentifier(SimCore::EXTERNAL);
|
||||
|
||||
auto ID4 = IDList.getNewIdentifier(SimCore::INTERNAL);
|
||||
auto ID5 = std::make_shared<SimCore::Identifier>(100, SimCore::EXTERNAL);
|
||||
|
||||
WHEN("constructing Position Object with data")
|
||||
{
|
||||
|
||||
THEN("positions attributes are correct")
|
||||
{
|
||||
REQUIRE(ID1 != ID2);
|
||||
REQUIRE(ID1 != ID3);
|
||||
REQUIRE(ID2 != ID3);
|
||||
REQUIRE(ID1 != ID4);
|
||||
REQUIRE(IDList.isInList(ID4) == true);
|
||||
REQUIRE(IDList.isInList(ID5) == false);
|
||||
REQUIRE(IDList.size() > 3);
|
||||
REQUIRE(IDList.size() == 4);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} //THEN
|
||||
} // WHEN
|
||||
} // GIVEN
|
||||
} //SCENARIO
|
||||
Reference in New Issue
Block a user