kima2/test/test_seller.cpp

32 lines
666 B
C++
Raw Normal View History

#define BOOST_TEST_MODULE seller
2018-07-09 21:42:04 +02:00
#include "../src/core/seller.h"
2018-07-11 08:33:16 +02:00
#include <array>
2018-07-09 16:54:04 +02:00
#include <boost/test/included/unit_test.hpp>
2018-07-11 08:34:23 +02:00
// using namespace boost::unit_test;
2018-07-11 08:34:23 +02:00
BOOST_AUTO_TEST_CASE(create_uuid_nil)
{
Seller seller{};
BOOST_TEST(seller.getUuid().is_nil() == true);
}
2018-07-09 17:52:46 +02:00
2018-07-11 08:34:23 +02:00
BOOST_AUTO_TEST_CASE(create_uuid)
{
2018-07-09 17:52:46 +02:00
Seller seller{};
seller.createUuid();
BOOST_TEST(seller.getUuid().is_nil() == false);
2018-07-11 08:33:16 +02:00
}
2018-07-11 08:34:23 +02:00
BOOST_AUTO_TEST_CASE(create_many)
{
2018-07-11 08:33:16 +02:00
constexpr unsigned int QUANTITY{10000};
std::array<Seller, QUANTITY> sellers;
for (unsigned i = 0; i < sellers.size(); i++) {
sellers[i] = Seller();
sellers[i].createUuid();
}
2018-07-09 17:52:46 +02:00
}