Skip to content

Commit f193f94

Browse files
Merge pull request #6 from Preponderous-Software/testing-placing-multiple-entities
Added a test for placing multiple entities into an environment.
2 parents b880ccf + b174d43 commit f193f94

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/tests.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,20 @@ void testRemovingEntityFromEnvironment() {
118118
std::cout << "Success" << std::endl;
119119
}
120120

121+
void testPlacingMultipleEntities() {
122+
std::cout << "---" << std::endl;
123+
std::cout << "Test 10 - Placing multiple entities" << std::endl;
124+
Entity entity1("Bob");
125+
Entity entity2("Phil");
126+
Entity entity3("Clarisse");
127+
Environment environment("Earth", 6);
128+
environment.addEntity(entity1);
129+
environment.addEntity(entity2);
130+
environment.addEntity(entity3);
131+
assert(environment.getNumEntities() == 3);
132+
std::cout << "Success" << std::endl;
133+
}
134+
121135
void seedRandomNumberGenerator() {
122136
srand (time (NULL));
123137
}
@@ -136,5 +150,6 @@ int main() {
136150
testRemovingEntityFromGrid();
137151
testPlacingEntityInEnvironment();
138152
testRemovingEntityFromEnvironment();
153+
testPlacingMultipleEntities();
139154
return 0;
140155
}

tests

56 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)