public static Hashtable InvokeOrchestration( OrchestrationInvoker orchestrationInvoker, OrchestrationBindingInfo orchestrationBindingInfo, Mock <IPowerShellServices> mockPowerShellServices, bool completed, PSDataCollection <object> output = null) { var invocationAsyncResult = CreateInvocationResult(completed); ExpectBeginInvoke(mockPowerShellServices, invocationAsyncResult, output); if (!completed) { SignalToStopInvocation(orchestrationBindingInfo); } var result = orchestrationInvoker.Invoke(orchestrationBindingInfo, mockPowerShellServices.Object); return(result); }