code cleanup
This commit is contained in:
parent
74719b762f
commit
6000bb3ef2
17 changed files with 65 additions and 67 deletions
|
@ -12,15 +12,15 @@ BOOST_AUTO_TEST_CASE(articles_sum)
|
|||
const int NUM_ARTICLES = 30;
|
||||
|
||||
Seller seller("Max", "Mustermann", 1, NUM_ARTICLES);
|
||||
std::vector<std::shared_ptr<Article>> articles{};
|
||||
ArticlesVec articles{};
|
||||
Sale sale{};
|
||||
|
||||
for(int i = 0; i < NUM_ARTICLES; ++i)
|
||||
{
|
||||
auto art = std::make_shared<Article>();
|
||||
auto art = std::make_unique<Article>();
|
||||
art->setPrice((i+1) * 10);
|
||||
articles.push_back(art);
|
||||
seller.addArticle(art);
|
||||
articles.push_back(art.get());
|
||||
seller.addArticle(std::move(art));
|
||||
}
|
||||
|
||||
for(int i = 0; i < 10; ++i)
|
||||
|
@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE(remove_article) {
|
|||
Sale sale{};
|
||||
|
||||
BOOST_TEST(art->isSold() == false);
|
||||
sale.addArticle(art);
|
||||
sale.addArticle(art.get());
|
||||
BOOST_TEST(art->isSold() == true);
|
||||
sale.removeArticle(art.get());
|
||||
BOOST_TEST(art->isSold() == false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue