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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
Hi,
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).
If you have got any better Ideas please tell me! Since the test output of the above approach does not work correctly.