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.
- 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
.
- Create a constructor and a destructor for your test class.
- Include the MCollectible declaration and definition macros for your test class.
The macro declaration must be public.
- 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.
- Override the Test function.
- Override the Setup and Cleanup functions, if necessary.