Testing private class member in C++ without friend [duplicate]
This question already has an answer here: How do I test a private function or a class that has private methods, fields or inner classes? 51 answers Today I had a discussion with a colleague on whether to test or not to test private members or private state in the class. He almost convinced me why it makes sense. This question does not aim to duplicate already existing StackOverflow questions about the nature and reason of testing private members, like: What is wrong with making a unit test a friend of the class it is testing? Colleagues suggestion was in my opinion a bit fragile to introduce