#include "repository.h" #include "domain.h" #include #include void test_repository(){ Repository repository; assert(repository.add(Bill("company1","serial1",100,true)) == true); assert(repository.add(Bill("company1","serial1",200,false)) == false); } Repository::Repository(){ } Repository::~Repository(){ } bool Repository::add(Bill bill){ if(std::find(this->_bills.begin(),this->_bills.end(),bill) != this->_bills.end()){ return false; } this->_bills.push_back(bill); return true; } std::vector::iterator Repository::begin(){ return this->_bills.begin(); } std::vector::iterator Repository::end(){ return this->_bills.end(); } std::vector Repository::bills(){ return this->_bills; }