BT

Facilitating the spread of knowledge and innovation in professional software development

Contribute

Topics

Choose your language

InfoQ Homepage News SharePoint Emulators Simplifies Unit Testing

SharePoint Emulators Simplifies Unit Testing

This item in japanese

Bookmarks

Microsoft has announced the availability of Visual Studio 2012 SharePoint Emulators which provide a module of Microsoft Fakes based shims and implements the basic behaviours of the SharePoint 2010 server object model.

In order to incorporate emulators into existing tests you should wrap the relevant code in a SharePointEmulationScope, which accepts EmulationMode enum as a parameter. It is enabled by default which in turn performs run time interception of all Microsoft.SharePoint.dll calls. Moreover, the relevant code will be automatically detoured at runtime and all calls against the Microsoft.SharePoint.dll assembly will be rerouted to the SharePoint emulators.

"SharePoint Emulators rely entirely on the Microsoft Fakes framework. They consist of concrete implementations of shims. However, developers will be able to reuse the same code when there is a need to run tests against a full blown SharePoint server," says Joshua Weber, Visual Studio 2012 Program Manager.

Visual Studio 2012 SharePoint Emulators are available via a NuGet package feed and requires Microsoft SharePoint 2010 Server and Microsoft Visual Studio 2012 Ultimate.In his blog post, Jousha examines the usage of emulators and also examines the steps required to extend the emulator.

"In order to unit test a SharePoint code, you need to isolate code. However, this technique is very costly and it is in this context SharePoint emulators will come in handy," says Joshua. He also feels that running tests against emulators provide significant performance improvements and reduced maintenance of test SharePoint infrastructure.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT