Compare commits

...

4 commits

Author SHA1 Message Date
1cee27ca70 added cmaketools config file 2018-07-09 20:09:30 +02:00
0a76e5933d Test cases for uuid 2018-07-09 17:52:46 +02:00
f7bd7d614a comment removed 2018-07-09 17:52:30 +02:00
6a075f2402 remove ctor/dtor 2018-07-09 17:50:43 +02:00
5 changed files with 15 additions and 5 deletions

5
.vscode/.cmaketools.json vendored Normal file
View file

@ -0,0 +1,5 @@
{
"variant": null,
"activeEnvironments": [],
"codeModel": null
}

View file

@ -5,7 +5,7 @@
#include <boost/uuid/uuid_generators.hpp> #include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp> #include <boost/uuid/uuid_io.hpp>
Entity::Entity() {} //Entity::Entity() {}
void Entity::createUuid() void Entity::createUuid()
{ {

View file

@ -8,8 +8,8 @@
class Entity class Entity
{ {
public: public:
Entity(); //Entity();
virtual ~Entity() = 0; //ivirtual ~Entity() = 0;
const boost::uuids::uuid& getUuid() const { return uuid; }; const boost::uuids::uuid& getUuid() const { return uuid; };
void createUuid(); void createUuid();
void createUuidFromString(const std::string& uuidString); void createUuidFromString(const std::string& uuidString);

View file

@ -6,4 +6,3 @@ set(TEST_SOURCES test_seller.cpp)
add_executable(testsuite ${TEST_SOURCES}) add_executable(testsuite ${TEST_SOURCES})
target_link_libraries(testsuite core Boost::boost Boost::filesystem Boost::unit_test_framework) target_link_libraries(testsuite core Boost::boost Boost::filesystem Boost::unit_test_framework)
#target_link_libraries(testsuite core)

View file

@ -6,7 +6,13 @@
using namespace boost::unit_test; using namespace boost::unit_test;
BOOST_AUTO_TEST_CASE( initial_test ) { BOOST_AUTO_TEST_CASE( create_uuid_nil ) {
Seller seller{}; Seller seller{};
BOOST_TEST(seller.getUuid().is_nil() == true); BOOST_TEST(seller.getUuid().is_nil() == true);
} }
BOOST_AUTO_TEST_CASE(create_uuid) {
Seller seller{};
seller.createUuid();
BOOST_TEST(seller.getUuid().is_nil() == false);
}