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.
eXtremeCRM 2013 Rome is the Can’t-Miss Conference
for Microsoft Dynamics® CRM Partners
There is no place like eXtremeCRM 2013 Rome. eXtremeCRM is the hub where Microsoft DynamicsCRM partners come together to forge business relationships, gain knowledge from real-world experiences and dive deep into current and future technologies. For Microsoft Dynamics CRM partner organizations, it is the annual conference to attend to nurture best practices, facilitate business growth, and educate each organization member. The highly anticipated conference will be held in Rome, Italy, 3 – 6 February, 2013.
eXtremeCRM offers role-specific tracks for every member of the partner business. Over 50 sessions are available to those in positions of sales, implementation and development. eXtremeCRM continues its deep focus on technical depth and app development this year and continues its commitment to helping partners grow. To this end, business leaders are invited to attend the eXecutive Summit being held at eXtremeCRM, a workshop-style event that will address key CRM business leadership issues.
Here is the session I will be presenting…
Dynamics under Control: Testing Microsoft Dynamics CRM from a 360 View
This session will show you how to easily test your Microsoft Dynamics CRM deployment at the different stages of the development lifecycle. It will cover all angles from designing your code for testability, unit, integration, performance, end-to-end and manual testing. It will introduce you to all the required tools, frameworks and processes you need to create and automate your tests through real life scenarios and practical demos. Demos will showcase the latest technologies such as Visual Studio 2012, TFS 2012, Microsoft Fakes & Test Manager 2012. This session will help you to increase productivity and quality while reducing risk and cost, thus resulting in happy developers and customers through successful deployments.
With its specialized content and enhanced technical focus (which includes the eXtreme App Challenge), all presented by industry leaders, experts, and innovators, eXtremeCRM 2013 Rome is the investment every partner organization should make.
And, like never before, Microsoft Dynamics will make a BIG splash at eXtremeCRM 2013 Rome. As a corporate sponsor, they have communicated that eXtremeCRM will be their #1 platform to share the latest Microsoft Dynamics CRM strategies and investments with partners.
There are a number of other session offerings I am looking forward to attending. For more information about eXtremeCRM 2013 Rome’s agenda and to register, visit eXtremeCRM 2013 Rome.
Get eXtreme in Rome!