#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(0,100,SimCore::ObjectSource::EXTERNAL);
    SimCore::Identifier ID2(0,100,SimCore::ObjectSource::EXTERNAL);
    SimCore::Identifier ID3(1,100,SimCore::ObjectSource::INTERNAL);
    SimCore::Identifier ID4(1,200,SimCore::ObjectSource::INTERNAL);


    WHEN("constructing Position Object with data")
    {

      std::string serID = ID1.serialize();
      SimCore::Identifier ID5(serID);
   
      THEN("positions attributes are correct")
      {
        REQUIRE(ID1.getNumber() == 100);
        REQUIRE(ID1.isExternal() == true);
        REQUIRE(ID1.getParentNumber() == 0);
        REQUIRE(ID1.isExternal() == true);

        REQUIRE(ID1 == ID2);
        REQUIRE(ID1 != ID3);
        REQUIRE(ID4 != ID3);
        
        REQUIRE(ID5 == ID1);




      } //THEN
    } // WHEN
  } // GIVEN
} //SCENARIO