I wanted to follow up on my last entry.  One thing I didn't mention in my last post is how the TDD is accomplished.  I believe you can use both Unit Testing and Automated Customer Acceptance tests as in standard projects, in project with MOSS.  For Automated Customer Acceptance Tests, you could use something like Fitnesse
In my experience doing TDD with MOSS (as a Project Lead/Manager), using standard patterns can be useful.  As I mentioned in the last post, we create objects that eventually become lists.  We only create these objects if there will be custom programming associated with them.  So let's take our Sales example from the previous post.  Our mock object and our Sharepoint Access object would be based on the same interface (we'll call it iCustomerService ).  All CRUD operations are in these objects.  Then we create a Customer Manager class that takes the Interface that contains all the methods that would be used for CRUD operations.  So the code might look something like this:
public class CustomerManager
{
private iCustomerService objCurrentCustomer
public CustomerManager(iCustomerService objCustomerAccess)
{
objCurrentCustomer = objCustomerAccess;
}
public int Create(Customer objCustomer)
{
objCustomerAccess.Create();
.. More stuff
}
} 
Hopefully that code gives you an idea of how you can switch between a mock object and your actual Sharepoint object.  The Create in your mock object is not really storing anything anywhere, but the Create in your Sharepoint based object will do the heavy lifting of creating that information into the list.  So in your Unit Tests when testing code for create, use the mock for most of them, but then use the Sharepoint Access objects to thourghoughly test your code.  Also, your automated acceptance tests can utilize the mocks for faster execution and testing of business logic.
One aspect of testing we haven't automated with mock objects is the events.  Once I have some solid experience doing that I'll post on that.  I will also try to post more code and info on actual TDD techniques with Sharepoint.  I know I've just scratched the surface here, I'll try to continue posting on doing this kind of development within the MOSS, WSS 2007 environment.
Sponsor