ADD: added Identifier class and Identifier Maker and storrage service plus tests
This commit is contained in:
40
tests/test_IdentifierClass.cpp
Normal file
40
tests/test_IdentifierClass.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "SimCore/Identifier.hpp"
|
||||
#include <SimCore/SimCore.hpp>
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
|
||||
|
||||
|
||||
SCENARIO("Testing the SimCorePositionClass")
|
||||
{
|
||||
GIVEN("different position in different forms")
|
||||
{
|
||||
|
||||
SimCore::Identifier ID1(100,SimCore::ObjectSource::EXTERNAL);
|
||||
SimCore::Identifier ID2(100,SimCore::ObjectSource::EXTERNAL);
|
||||
SimCore::Identifier ID3(100,SimCore::ObjectSource::INTERNAL);
|
||||
SimCore::Identifier ID4(200,SimCore::ObjectSource::INTERNAL);
|
||||
|
||||
|
||||
WHEN("constructing Position Object with data")
|
||||
{
|
||||
|
||||
THEN("positions attributes are correct")
|
||||
{
|
||||
REQUIRE(ID1.getNumber() == 100);
|
||||
REQUIRE(ID1.isExternal() == true);
|
||||
REQUIRE(ID1.getPair().first == 100);
|
||||
REQUIRE(ID1.getPair().second == true);
|
||||
|
||||
REQUIRE(ID1 == ID2);
|
||||
REQUIRE(ID1 != ID3);
|
||||
REQUIRE(ID4 != ID3);
|
||||
|
||||
|
||||
|
||||
|
||||
} //THEN
|
||||
} // WHEN
|
||||
} // GIVEN
|
||||
} //SCENARIO
|
||||
Reference in New Issue
Block a user