This project is read-only.
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.

The framework achieves this by providing the below:

Test Library

  • Bases classes for testing Plug-ins and Custom Workflow Activities. All tests extend from these classes.
  • These cover your Unit Tests & 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

Productivity Tools

  • Custom Visual Studio 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

Webcasts and Slides

  • Unit Testing Plugins
    • This session will provide you with an Introduction to Unit Testing concepts and best practices.
    • You will learn how to apply this to fake the CRM plug-in to unit test Dynamics CRM plug-ins using Microsoft Fakes.
    • This session will also introduce you to the xRM Test Framework and show how you can speed up the creation of your tests.
  • Unit Testing Custom Workflow Activities
    • This session will focus on using the Unit Testing concepts from the previous session and show you how you can apply that to test custom workflow activities using Moq.
    • This session will also introduce you to the xRM Test Framework and show you how you can speed up the creation of your tests.
    • Finally you will see how you can execute these unit tests as part of your builds.
  • Integration Testing Plugins
    • This session will provide you with an Introduction to Integration Testing concepts and best practices.
    • We will look at the plug-in pipeline and see how you can apply the concepts to write automated integration tests for both synchronous and asynchronous plug-ins.
    • This session will also introduce you to the xRM Test Framework and show how you can speed up the creation of your tests.
  • Integration Testing Custom Workflow Activities & Workflows
    • This session will focus on how to write Integration Tests for your CRM Processes using the concepts from the previous session.
    • We will show you how to test custom workflow activities using CRM Workflows and Custom Actions.
    • This session will also introduce you to the xRM Test Framework and show how you can speed up the creation of your tests.
    • Finally you will see how you can execute these integration tests as part of your builds.

Source Code

  • All the code is completely available
  • Framework solution (Xrm.Framework). Core implementation of the framework. It contains:
    • Bases classes
    • Definition of the templates
    • Visual Studio extension.
  • Framework Sample solution (Xrm.Solutions.FrameworkSample). Sample Visual Studio solution based on common business scenarios and the CRM Developer Toolkit. It contains:
    • Plugins (Xrm.Solutions.FrameworkSample.Plugins project)
    • Custom Workflow Activities (Xrm.Solutions.FrameworkSample.Workflow project)
    • Unit tests
      • Xrm.Solutions.FrameworkSample.UnitTests project: Sample tests without using our current framework (a lot of effort!)
      • Xrm.Solutions.FrameworkSample.XrmUnitTests project: tests using Xrm Test Framework (more productive!)
    • Integration tests (Xrm.Solutions.FrameworkSample.XrmIntegrationTests project): sample tests using Xrm Test Framework
    • Package project (See CRM Developer Toolkit)
    • Common library (Xrm.Solutions.FrameworkSample.Common): Common logic to be shared by Plugins and Custom Workflow activities. This assembly is automatically merged (see ILMerge) with the assemblies Xrm.Solutions.FrameworkSample.Plugins and Xrm.Solutions.FrameworkSample.Workflow before they are deployed to CRM.

Have a look at the Documentation to find out more information and How to Get Started.

Please, let us know any question or feedback using the Discussion section.

Last edited Sep 20, 2014 at 6:33 PM by waelhamze, version 14