Creating a test class

When you have identified the conditions you want to test in your objects, you can create a test class to hold your decision function.

The following steps create a test class for the SampleObject class. The test class compares the value sent to the object with the value the object sends back.

  1. Derive your class from the appropriate TTest class.
    For most tests, you derive your test from TTest so the minimum requirement for using the Test framework is to include Test.h.
  2. Create a constructor and a destructor for your test class.
  3. Include the MCollectible declaration and definition macros for your test class.
    The macro declaration must be public.
  4. Give your test class access to the class you are testing.
    In your implementation file, you must include the header for the class you are testing. In the *.PinkMake file, you must link to the shared library that contains your target class.
  5. Override the Test function.
  6. Override the Setup and Cleanup functions, if necessary.

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker