3 ms·
It would've required completely rewriting the solution. The reason we used friend functions in the past was when we had god objects that we needed to test. It d
by jschwartzi 9y ago
It would've required completely rewriting the solution. The reason we used friend functions in the past was when we had god objects that we needed to test. It did not make any sense here since the class under test had a single responsibility. It would also have made the implementation more complicated and would have tightly coupled the unit tests to the implementation of the class.