fake-xrm-easy icon indicating copy to clipboard operation
fake-xrm-easy copied to clipboard

Add Overload for RegisterPluginStep

Open BetimBeja opened this issue 4 years ago • 3 comments

Hello Jordi, we should add an overload to RegisterPluginStep where you can pass the plugin instance similar to ExecutePluginWith. This way we can test if a plugin fired or not in a test, or inject dependencies in our plugin instances.

BetimBeja avatar May 10 '20 12:05 BetimBeja

Agree yep, I'll add this to the backlog :)

jordimontana82 avatar May 10 '20 14:05 jordimontana82

just wondering if you fixed this in v2

BetimBeja avatar Feb 08 '23 21:02 BetimBeja

Good point @BetimBeja

It is not there, but rather than adding another overload, I would add another property to the PluginStepDefinition, like:

IPlugin PluginInstance { get; set; }

And validate that at least either the PluginInstance (custom instance with injected dependencies) or the PluginType (default constructor) name were set.

jordimontana82 avatar Feb 08 '23 23:02 jordimontana82