Getting ready

To get going, we will need the refactored code from the Refactoring your plugin using a three-layer pattern recipe earlier in this chapter. This version of our code uses the CrmTracing concrete implementation of ICustomTracingService and the EmailDataAccessLayer concrete implementation of IEmailDataAccessLayer. We chose EmailDataAccessLayer instead of EmailDataAccessLayerQueryExpression since the faking framework will leverage OrganisationServiceContext for all CRUD operations and actually execute our LINQ queries through an in-memory context.

As with the previous unit testing recipes, we will be using the out-of-the-box Visual Studio unit testing framework, so you will need a recent version of Visual Studio. In this instance, we used Visual Studio 2015. Furthermore, we will leverage the Moq framework to mock the classes we are not interested in. As described in the introduction, we will also utilize the XrmUnitTest framework to fake the organization service.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.213.209