A new column on TSS is about making your code more testable by following a few principles:
- Use Interfaces
- Define a Base Test Class
- As Much as Feasible, Make Everything Return a Value
- Separate Data Access from Business Logic
- Make Use of Configuration
- Make Your Classes Do Only One Thing
- Have Domain Object Factories
- Think carefully about packaging, assemblies and namespaces
- Pick a Logging Strategy Early
The article focuses on NUnit for Unit Testing and has some pretty good ideas.
Check out the article here.
Posted by David Hayden, Tampa Programmer