Applying tests for superclass on derived class
Say you have a C++ class B
derived of class A
. You have extensive tests set up for class A
that you would als开发者_如何学Pythono like to run over instances of class B
, as it should fully support A
's functionality. Of course you also have additional B
specific tests.
How would you setup the tests so that you don't have to duplicate all of A
's tests for B
?
A specific answer for Google Test would be great.
Use Typed Tests (if you know in advance which types you want to test) or Type-Parameterized Tests (if you want to decouple fixture creation from test logic).
精彩评论