G
Guest
Here's my problem.
Have a database interface with several methods.
I created a database class to implement the interface,
and a set of unit tests to test each method.
Now I want to support another database provider.
The implementation is very easy: I simply
create a new database class, and implement all the methods using the new
database provider.
My question is: How do I get this same set of unit tests to run in a loop?
My problem is that I have one test class with many test methods,
and I want the testing framework to run each of those tests once for every
different database implementation that I've coded.
I certainly could have a single test method that has a loop that calls a
hand-crafted set of test method's.
But that would put the looping and every single test method in one single
unit test method. Then I would lose the nice partitioning that the
conventional test architecture provides.
I know this may be confusing when you read it.
Just imagine one of your typical unit tests. Now imagine you want to repeat
all of those unit tests exactly as they are structured, except you want to
change one single variable for each run.
Thanks
Have a database interface with several methods.
I created a database class to implement the interface,
and a set of unit tests to test each method.
Now I want to support another database provider.
The implementation is very easy: I simply
create a new database class, and implement all the methods using the new
database provider.
My question is: How do I get this same set of unit tests to run in a loop?
My problem is that I have one test class with many test methods,
and I want the testing framework to run each of those tests once for every
different database implementation that I've coded.
I certainly could have a single test method that has a loop that calls a
hand-crafted set of test method's.
But that would put the looping and every single test method in one single
unit test method. Then I would lose the nice partitioning that the
conventional test architecture provides.
I know this may be confusing when you read it.
Just imagine one of your typical unit tests. Now imagine you want to repeat
all of those unit tests exactly as they are structured, except you want to
change one single variable for each run.
Thanks