ITestApiSimulatePluginInvocation Method

Invoke a plugin method. This method cannot work with legacy plugins.

Definition

Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
C#
PluginTestScenario SimulatePluginInvocation(
	string pluginName,
	string methodName
)

Parameters

pluginName  String
Name of the plugin.
methodName  String
Invoked method name.

Return Value

PluginTestScenario
Return the PluginTestScenario object with predefined plugin result

Example

C#
                    var pluginResult = new PluginResult { Data = new Dictionary<string, object>() };
pluginResult.Data.Add("subject", "Test plugin on Dev env");
pluginResult.Data.Add("body", "Test plugin on Dev env");
var testApi = ctx.Use<ITestApi>();
testApi.SimulatePluginInvocation("CwMail", "SendEmail").Parameters(parms => parms["subject"].ToString() == "Test plugin on Dev env").Returns(pluginResult);
                  

See Also