SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've read the articles from Andrew Woodward (21Apps) trying to get started with unit testing on WSS, but when I try something more advanced, like Webpart connections, I don't know how to start testing them.

Anyone has experience on this?

Where can one find advanced resources for Unit Testing on WSS/MOSS?

share|improve this question
I've made this a Community Wiki since unit testing in SharePoint is such a hot potato! – SPDoctor Nov 27 '11 at 16:45


What is the specfic thing you are looking to unit test? Do you have some specific logic that you want to test for example - you have logic that does different things depending on the passed type of object.

Or are you looking to make sure the Web Parts are connected?

If it is the first then you really don't need to be concerned about how the method is called (i.e. from the web part manager/framework) you just want to test the scenarios work as expected.

If it is the latter then this is really testing SharePoint and I would not Unit Test this specifically, if you want some automation you may want to look at screen recording type options - but again may be just something you can get your Testers to validate.

share|improve this answer
Andrew, you are right!, the problem was that I missed the point of the unit tests, and starting doing integration testing.... Now that I revise those tests I know that I should not focus on the interactions, but on the internals of the component. – Nicolas De Irisarri Nov 3 '11 at 16:23

The PnP Guidance Library has some discussion of implementing various types of testing for SharePoint solutions.

In short, it's not as easy as it should be...

share|improve this answer

You could test it with a web testing tool, for example watir vs selenium.

In this case you are just testing that the web pages work as expected.

share|improve this answer
i would say WATIN instead of WATIR, since WATIR is Ruby and WATIN is .NET ;-) But in general i agree with Andrew, no need to test OOTB functionality as such – Anders Rask Jan 30 '10 at 8:56
UI tests (e.g. Visual Studio coded UI tests, Selenium, Watin) are not strictly unit tests, which should test a unit of code (e.g. a function) in isolation. They also run too slowly in general to be useful for TDD. – SPDoctor Nov 27 '11 at 13:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.