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

Everything i read about unit testing mentions TypeMock isolator. thats good when you can control what unit testing and mocking tools you are using in the project but I am unable to use TypeMock. Instead the project uses Moq.

I cant however find a good resource for examples on Moq with sealed classes which lets face it SharePoint 2010 is full of!

Does anyone have any samples?

share|improve this question
up vote 2 down vote accepted

Simply put you cannot use Moq to mock behaviour of sealed classes or at least not easily. Microsoft Research have released a free mocking framework for this purpose called Moles which is available to download from

Let us know if this is what you're looking for and we can provide further advice and samples.

share|improve this answer
its not ideal as I cant use moles in my project but thanks :-) – Mauro Jun 14 '11 at 15:21

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.