Friday, December 31, 2010

Upgrading to newer versions of Pex and Moles

I just recently started using Pex and Moles after reading about it on the Microsoft Visual Studio web site.  I have been searching for a Microsoft-endorsed method for creating Mock objects and it seems that Microsoft finally came to the rescue with Moles.  I had been reviewing the possible use of NMock, RhinoMocks, Moq or even TypeMock, but the documentation on the open source Mock frameworks was sparse and TypeMock was quite expensive.

If you are not already familiar with Pex and Moles, you can read more about them here:
http://research.microsoft.com/en-us/projects/pex/

You can download a combined installation of Pex and Moles through your MSDN Subscription or else Moles is available for individual download from the Visual Studio Gallery.

However, once I began using Pex and Moles for inclusion within my Unit Tests, the problem I started encountering was that there were new releases of Pex and Moles nearly every few weeks.  Therefore, each time I upgraded my installation of Pex and Moles, I would encounter problems with my builds because of the dependencies on the particular version of Moles that I incorporated into my Visual Studio Unit Tests.

Well, just by chance, I discovered the option to be able to upgrade all of my .Moles files within my solution.  Simply right-click on the solution file and select the menu option for "Upgrade .Moles files".


After using this option, I can now successfully upgrade my versions of Pex and Moles without worry!

No comments:

Post a Comment