is there way to write tests for a bunch of classes by using their common interface class instead?
I want to write a test only once using the interface defined by the root parent but I also want this particular test to run for every instance of the derived classes (for example by providing the instances through factorys).
How could I accomplish this in an elegant way?
Hi there! I found a solution myself, but it is not a particularly prety one. Here is an example (suppose IVehicle is the interface class to Car and Truck).
template <class T>
class IVehicleTest : public CPPUNIT_NS::TestFixture
pVehicle = new T();
CPPUNIT_ASSERT( pVehicle->wrumwrum() );
If you have got any better Ideas please tell me! Since the test output of the above approach does not work correctly.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.