I would say that a lot of it depends on finding a balance that you're happy with. When I first started out with TDD, I went very over-board with testing the interactions - I had very high code-coverage but my tests were very brittle, and would break as soon as there was any refactoring.
These days, I tend to write unit tests for critical or complex logic (business processes, validation rules etc) but I don't tend to write unit tests for controller layer - my controller layer is very thin and any issues would quickly be made visible via UI testing. But this is just my personal preference, and also varies from project-to-project. I've found that by having a very thin controller layer, the need to explicitly write tests for it becomes very minimal. If you are going to test the controller layer, then I would have tests that perhaps do the following (just an example):
All the best with the project, I hope you find a comfortable balance with the testing.
Jeremy
These days, I tend to write unit tests for critical or complex logic (business processes, validation rules etc) but I don't tend to write unit tests for controller layer - my controller layer is very thin and any issues would quickly be made visible via UI testing. But this is just my personal preference, and also varies from project-to-project. I've found that by having a very thin controller layer, the need to explicitly write tests for it becomes very minimal. If you are going to test the controller layer, then I would have tests that perhaps do the following (just an example):
- When a controller action is passed a valid model instance, the user is redirected to a success page
-
When a controller action is passed an invalid model instance, the page is re-rendered and there are errors in the model-state (if you're using MVC for example)
I personally don't tend to go any deeper than that. In your particular case, if you're finding that you're frequently forgetting to change the name of the ruleset, then I'd look at finding a way of using conventions to automatically work out the correct ruleset name (maybe based on the name of the controller action or something) rather than hard-coding it. This way your infrastructure is taking care of the problem.
All the best with the project, I hope you find a comfortable balance with the testing.
Jeremy