KIMA2 ist ein kleines Kassenprogramm für Kindersachenmärkte. https://www.rustysoft.de/?01_kima2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
1013 B

#define BOOST_TEST_MODULE seller
#include "../src/core/seller.h"
#include <array>
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE(create_uuid_nil)
{
Seller seller{};
BOOST_TEST(seller.getId().is_nil() == true);
}
BOOST_AUTO_TEST_CASE(create_uuid)
{
Seller seller{};
seller.createUuid();
BOOST_TEST(seller.getId().is_nil() == false);
}
BOOST_AUTO_TEST_CASE(create_many)
{
constexpr unsigned int QUANTITY{10000};
std::array<Seller, QUANTITY> sellers;
for (unsigned i = 0; i < sellers.size(); i++) {
sellers[i] = Seller();
//sellers[i].createUuid();
}
}
BOOST_AUTO_TEST_CASE(with_article) {
Seller seller{"Max", "Mustermann"};
auto article = std::make_unique<Article>();
article->setDescription("Test article");
seller.addArticle(std::move(article));
BOOST_TEST((article == nullptr));
BOOST_TEST(seller.getArticles(false).at(0)->getDescription() == "Test article");
BOOST_TEST(seller.numArticlesSold() == 0);
}