It seems counterproductive for testing things that have no reason to refuse (auto-properties, empty Constructors) ...
This may seem counterproductive, but if you have code that depends on the defualt state of your newly built objects, then this is worth checking. Someone may enter and change the default values ββfor the fields, and your code will break.
It may be useful to remember that your tests are designed not only to find things that fail, but also to verify that your code matches the declared contract. You can argue that you donβt need to worry - if the contract breaks, then the code will also break depending on this. This is true, but creates tests that do not work with "remote" problems. Ideally, a problem with the class should first cause the unit test to fail in it, and not in the unit tests of its clients.
Performing TDD without any requirements or design to work is difficult. With traditional coding, where you sit down and knock out something that does what you want, the requirements evolve as the code evolves - the requirements almost come from the code as you dig deeper and learn in more detail what you need. But with TDD, tests are the embodiment of requirements, and so you must have these front, crystal clear in your mind. If you start with a blank sheet, then you need to constantly analyze requirements, test design, and code design.
source share