Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • I disagree. If you can't make it happen either via a mock or passing in data, then why have it in your code. Getters and setters don't need their own tests put would be tested via other unit tests of the system for verifying the expected functionality. Commented Mar 9, 2012 at 19:31
  • Sure, setters / getters are tested indirectly with other tests but when someone says "test everything" I assume they mean create tests specfically for those kinds of things. I always tell people "test the important things." Things like setters and getters don't fit into that definition for me. Commented Mar 10, 2012 at 0:31