Here is how the client code would look:
void testMove() {
Move move = new MoveInfo(5, 3);
assert(move->getCoins() == 5 && move->getPile() == 3);
cout << "testMove succeeded.\n";
}
|
Note that the test code is collected into a procedure.
|
The procedure can be
called by:
int main(int argc, char** argv) {
testMove();
cout << "All tests succeeded.\n";
return (EXIT_SUCCESS);
}
|
|