Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

3 Answers 3

Nicolas,

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
add comment

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
add comment

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

http://raveendran.wordpress.com/2009/10/28/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 ;-) watin.sourceforge.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
add comment

Your Answer

 
discard

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.