I am pretty new to C++
unit testing
and I am in the following situation: I have a class which is (of course) has public
and private
members. I want to test a method from private/protected
section. For tests I use QtTest
package but it is not strict requirement. Which is the best way of test such method?
My suggestions are:
1. Subclass it with `Test class` (multiple inheritance)
2. Add friend class (not the best way in my opinion)
Aucun commentaire:
Enregistrer un commentaire