I'm looking for the most readable way to share tests of different implementations of an interface.
The most popular, but rather old question on this subject was - Writing a single unit test for multiple implementations of an interface.
To the question above, 2 main and different answers were given -
- Parameterized tests.
- Test inheritance.
I'm not satisfied with both answers.
Parameterized test - the answer doesn't include a code example of how to parameterize each subclass. Also, I personally have a hard time with parameterized test and I find the API not intuitive at all.
I always fear inheritance overusing, and I'm not sure if a test inheritance is a good practice.
I wonder what is the best answer to this question in 2018.