There's more...

XrmUnitTest is a very powerful framework capable of much more than faking an in-memory organization service. Daryl LaBar explains in his video (https://www.youtube.com/watch?v=dRz1X6pdsk4) how you can use the framework to switch between an in-memory context and the actual live connection to Dynamics 365, and much more. The framework does have its limitations and LaBar covers a few of them in his video.

Other alternatives to the XrmUnitTest framework are Microsoft's Business Solutions MVP Jordi Montaña's Fake Xrm Easy https://github.com/jordimontana82/fake-xrm-easy and out-of-the-box Visual Studio fakes. Note that using Visual Studio fakes doesn't cater for an in-memory context, but rather mocks the results.

This recipe covered end-to-end plugin testing without a Dynamics 365 connection. Alternatively, you can deploy and test your plugin in Dynamics 365 (as described in Integration testing your plugin end-to-end). Another option is to simply establish an organization service connection to a live Dynamics 365 (as described in Connecting to Dynamics 365 from other systems using .NET from Chapter 5, External Integration) to inject into a data access layer which you then inject into your business logic. The advantage of the latter option is that you are still debugging the core of your plugin locally (since the entry point has been refactored to only call the business logic) without deploying it to your instance, but with a live Dynamics 365 connection.

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

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