Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to simulate a CRM plugin sandbox isolation mode in unit tests?

Context

I would like to write some unit tests against classes what will be utilized by CRM 2016 CodeActivity and Plugin classes. The final assembly will be registered in sandbox isolation mode.

I want to be sure if a test case is green when running unit tests, it will not be more restricted in sandbox isolation security restrictions when registered and run in CRM.

Question

Is there any way to simulate the sandbox isolation when running unit tests?

like image 718
g.pickardou Avatar asked Jun 28 '16 15:06

g.pickardou


People also ask

What is isolation mode in CRM Plugin?

Plugin isolation mode signifies the level of security restrictions imposed on the plugin execution pipeline. The isolation mode is specified on the assembly level and not on the individual plugin step. When a plugin assembly is registered, it can either be registered in an isolated or sandbox mode or in a none mode.

What is Mscrm sandbox?

isolated environment, also known as a sandbox, a plug-in or custom activity can make use of the full power of the Microsoft Dynamics CRM SDK to access the organization web service. Access to the file system, system event log, certain network protocols, registry, and more is prevented in the sandbox.

What are sandbox plugins?

The Sandbox plugin enables Developers to test changes in their apps by pointing them to a sandbox environment. It provides a simple UI to set and modify the URL to a development host that acts as a sandbox directly on the desktop, which prevents you from entering potentially long and complicated URLs inside your app.


1 Answers

That's a really good question. You can maybe simulate running the plugin assemblies and code activities in a sandbox based on this Sandbox example.

With that example you could run the codeactivity with a limited set of permissions.

Now, what are the exact limitations of CRM online? Found this article. There is a Sandbox Limitations sections with some of them. If you find another one please let me know. Cause I'd be keen on adding this feature to FakeXrmEasy

Cheers,

like image 136
Jordi Avatar answered Sep 20 '22 17:09

Jordi