Skip to content

Commit

Permalink
Merge pull request #6 from Preponderous-Software/testing-placing-mult…
Browse files Browse the repository at this point in the history
…iple-entities

Added a test for placing multiple entities into an environment.
  • Loading branch information
dmccoystephenson authored Aug 31, 2022
2 parents b880ccf + b174d43 commit f193f94
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ void testRemovingEntityFromEnvironment() {
std::cout << "Success" << std::endl;
}

void testPlacingMultipleEntities() {
std::cout << "---" << std::endl;
std::cout << "Test 10 - Placing multiple entities" << std::endl;
Entity entity1("Bob");
Entity entity2("Phil");
Entity entity3("Clarisse");
Environment environment("Earth", 6);
environment.addEntity(entity1);
environment.addEntity(entity2);
environment.addEntity(entity3);
assert(environment.getNumEntities() == 3);
std::cout << "Success" << std::endl;
}

void seedRandomNumberGenerator() {
srand (time (NULL));
}
Expand All @@ -136,5 +150,6 @@ int main() {
testRemovingEntityFromGrid();
testPlacingEntityInEnvironment();
testRemovingEntityFromEnvironment();
testPlacingMultipleEntities();
return 0;
}
Binary file modified tests
Binary file not shown.

0 comments on commit f193f94

Please sign in to comment.