3 ms·
> That's potentially one philosophy on it, sure. That's not potentially one philosophy, that's the definition of unit testing. > Yet that still doesn't preclu
by camus2 9y ago
> That's potentially one philosophy on it, sure.
That's not potentially one philosophy, that's the definition of unit testing.
> Yet that still doesn't preclude private methods from being an independently testable unit
Then these methods ain't private as they break encapsulation. You can't have it both ways. Either a method is private or it isn't.
> Implementation details are the meat of the whole thing
But unit testing isn't about testing implementation details, it's about testing a specification that your API must respect, because that's the behavior collaborators consuming that API rely on. If your collaborators can call a private API then that API isn't private at first place.