previous | index | next

Testing the MoveInfo Class

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.


previous | index | next