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

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

1 Answer

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 http://research.microsoft.com/en-us/projects/moles/

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
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.