Unit Testing SharePoint Solutions – Getting into the SharePoint Object Model

The white paper Unit Testing Sharepoint Solutions – Getting into the Object Model

The code supporting the white paper Unit Testing SharePoint Solutions – Getting in the Object Model – The Code

The first document in the Beginners Guide to Test Driven Web Part Development Series provided an introduction to unit testing, a look at how TDD influences your design and makes your code testable. That document deliberately avoided testing the SharePoint Object Model as in order to do this we need to introduce the concept of mocking.This second document in the series will cover the concept of mocking, look at one tool that makes this possible and demonstrate some of the very recent additions that make unit testing the SharePoint object model really easy.

In the white paper we specifically look at using the new Typemock Isolator (V5.1.1 or later) AAA API to demonstrate testing against SPSite, SPWeb, SPList and SPListItem objects.
Some of the key things you should get from this white paper are

  • How to unit test the object model
  • These unit tests are much less brittle using the new AAA API
  • You do not need a specific SharePoint configuration on your development machine, we are not Integration testing
  • Reinforce TDD approach to SharePoint development

The white paper Unit Testing Sharepoint Solutions – Getting into the Object Model

The code supporting the white paper Unit Testing SharePoint Solutions – Getting in the Object Model – The Code

This white paper is based on our views and experience, we welcome your comments and suggestions and will update the white paper as the community knowledge, experience and best practice evolves.