Tuesday, August 26th, 2008

Unit Testing SharePoint Solutions – The Basics



Unit Testing SharePoint Solutions - The Basics

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

The code to support this white paper.

  • well, Solutions—The Basics. Andrew Woodward explains the fundamentals of writing unit tests for SharePoint solutions
  • Thanks for this paper. As someone who knows only a little about unit testing, this is a great starting point on the practicalities of unit testing.

    It was a good idea to focus on unit testing a class at first, rather than getting bogged down in the SharePoint object model and the web part itself. I found when going through the tutorial that I occasionally got "Unable to copy" compiler errors in Visual Studio when the DLL was locked by NUnit. The solution was to reload the project in NUnit before compiling - it might be worth mentioning this in the notes.
  • Ali Danger
    From what I can see this is a tutorial on (a) writing a generic unit test; and (b) writing a web part, but does not cover writing a unit test for a web part. Quite helpful, but didn't really solve my problem.
  • Ali

    have a look at the second White paper. This one really shows how you an design testable code even with SharePoint.

    If you have any specific challenges let me know.
  • Two things -

    First, I agree with Mark that the formatting of the doc is weird. Most annoying is that the hyperlinks aren't clickable, especially the ones without URLs (ex the unit testing articles referenced on the bottom of page 3.

    Second, the comments from Allgates and Traveller_Adventure have a bit of a spammy feel to them (though without my having visited their links). Just saying...
  • Thanks Jim, have now removed what were rightly spam comments that got through the net.

    I think the PDF being a bit off was down to the way it was generated, will see if the new Office 2007 PDF export works better.
  • Mark Smith
    Many thanks. I've downloaded this but not yet read it. The text formatting is weird - like the whole document is a btimap, BTW.
blog comments powered by Disqus