kima2/test/test_article.cpp

22 lines
490 B
C++
Raw Normal View History

2018-07-11 12:54:33 +02:00
#define BOOST_TEST_MODULE article
#include "../src/core/article.h"
#include "../src/core/sale.h"
2018-07-11 12:54:33 +02:00
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE(create_article)
{
Article article{};
BOOST_TEST(article.getUuid().is_nil() == true);
}
BOOST_AUTO_TEST_CASE(check_is_sold)
{
Article article{};
BOOST_TEST(article.isSold() == false);
2018-07-20 11:52:26 +02:00
auto salePtr = std::make_unique<Sale>();
salePtr->addArticle(&article);
2018-07-11 12:54:33 +02:00
BOOST_TEST(article.isSold() == true);
}