No exception when trying to erase an object not in sheet
This commit is contained in:
parent
8a5b2dd927
commit
4f694d0bbe
3 changed files with 21 additions and 7 deletions
|
|
@ -153,6 +153,18 @@ TEST_CASE("[D] Pushing popping BillyObjects", "[pushpop][0]") {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("[D] Double erase no throw", "[pushpop][1]") {
|
||||
BillyObjects gestionnaire{};
|
||||
CharacterSheet sheet;
|
||||
REQUIRE(sheet.get_objects().empty());
|
||||
|
||||
REQUIRE_NOTHROW(gestionnaire.insert_object(sheet, weapons::Sword));
|
||||
REQUIRE(gestionnaire.insert_object(sheet, weapons::Sword));
|
||||
|
||||
REQUIRE_NOTHROW(gestionnaire.erase_object(sheet, weapons::Bow));
|
||||
REQUIRE_FALSE(gestionnaire.erase_object(sheet, weapons::Bow));
|
||||
}
|
||||
|
||||
TEST_CASE("[D] Printing Billy's objects", "[printing]") {
|
||||
for (const auto &object: BillyObjects::all_objects) {
|
||||
const std::unique_ptr<GenericObject> obj = test::get_obj(object);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue