Category Archives: xRM Test Framework
Join me for the next meeting of the CRMUG UK Regional Chapter Meeting on Thursday, July 17th at Microsoft Cardinal Place Victoria, London. The July meeting will focus on using Microsoft Dynamics CRM for managing Customer, Citizen, and other kinds of “Service”. Don’t miss this opportunity to experience what CRMUG has to offer you and fellow Dynamics CRM users in your area!
I will be presenting a session about “One-Click Dynamics CRM Deployments ” at 11:15 AM.
“Find out how you can automate the build and deployment processes for your CRM solutions. The session will demonstrate how the latest tools from the CRM SDK, TFS 2013, Visual Studio Release Management & xRM CI Framework can work together to implement end to end one-click deployments of your enterprise Dynamics CRM Solutions across all your environments. This will allow you to deliver CRM more frequently in a consistent and reliable way.“
Don’t forget to take a look at the full Agenda in here. There will be multiple tracks with a range of topics to suite all roles.
Looking forward to seeing you all in there.
The xRM Test Framework is a set of tools that allows you easily and quickly create automated units and integration tests for your Dynamics CRM extensions.
Testing plug-ins and custom workflow activities can be quite challenging and time consuming using standard approaches. This sometimes discourages developers from writing automated tests for Dynamics CRM extensions. This can lead to quality issues and wasted effort and time down the line. The framework attempts to encourage the adoption of testing best practices in Dynamics CRM projects.
Below is what the framework provides.
Base Test Library
- Bases classes for testing Plug-ins and Custom Workflow Activities. All tests extend from these classes.
- These cover your Unit & Integration Tests
- These do most of the ground work and allow you to focus on writing your test scenarios in your tests.
- Available via NuGet
- Support for Microsoft Fakes & Moq
Below is a high level diagram for the base classes.
To add the Xrm.Framework.Test assembly to your existing Test project.
- In your existing test project – Right click on References -> Manage NuGet Packages…
- Click on Online in the left tree and then search for “Xrm.Framework.Test”
- Click install – this will add the assembly and the NuGet package to your project
You should be able to see the below:
- These provide templates to enforce standard patterns and best practices
- Templates allow you to easily and consistently create your tests
- Visual Studio Project Templates for creating Test Projects
- Visual Studio Templates for creating Tests for different extensions
- Available via the Visual Studio Gallery
To get start just install the extension from the visual studio.
- Open Visual Studio
- From the menu bar click on Tools -> Extensions & Updates…
- Click on Online in the left tree and then search for “xRM”
- Download and install the extension
You should be able to see the below:
You can also download it from Visual Studio Gallery directly.
After you install the extension you should be to create a new Test project by going into the “Dynamics CRM” category in Visual Studio. Below is what you should be able to see in addition to the CRM Developer Toolkit templates.
After you create the project you should be able to add new Tests to your project using the Framework templates. Again these will be in the “Dynamics CRM” category as you can see below.
Finally I would like to thank Ramon Tebar (MVP) for his help and contributions especially in making this Framework work with Microsoft Fakes and Dynamics CRM 2013.
So whats next? In future posts I will show how to create different types of tests for your CRM extensions.