Comments by "ForgottenKnight1" (@ForgottenKnight1) on ""TDD Is An Essential" | Martin Fowler On Test Driven Development And Self Testing Code" video.
-
@gJonii accessors are not code smells and you should not test implementation details, you should test behavior, else your tests are brittle, cumbersome and an impediment to any sort of refactoring. As for accessors, you should apply the principle of hiding as much information from the exterior as possible. If a class is not required to expose a property, make it private by practicing proper encapsulation. If it is required to expose a property, think how that exposure is allowed ? maybe some formatting, filtering or remodelling is required, requiring some methods, or if you simply want to give access to it, then leave it public.
1