/// <summary> /// Initialises a new instance of the <see cref="OrganizationServiceFactoryMock"/> class /// </summary> /// <param name="organizationServiceMock">An instance of <see cref="IOrganizationServiceMock"/> for mocking calls to Dynamics 365</param> public OrganizationServiceFactoryMock(IOrganizationServiceMock organizationServiceMock) : base() { this.organizationServiceMock = organizationServiceMock; this.Setup(factory => factory.CreateOrganizationService(It.IsAny <Guid>())).Returns(this.organizationServiceMock.Object); }
/// <summary> /// Initialises a new instance of the <see cref="ServiceProviderMock"/> class /// </summary> /// <param name="pluginExecutionContextMock">An instance of <see cref="IPluginExecutionContextMock"/> used for querying plugin activities</param> /// <param name="organizationServiceMock">An instance of <see cref="IOrganizationServiceMock"/> for mocking calls to Dynamics 365</param> /// /// <param name="tracingServiceMock">An instance of <see cref="ITracingServiceMock"/> used for verifying calls to the tracing service</param> public ServiceProviderMock(IPluginExecutionContextMock pluginExecutionContextMock, IOrganizationServiceMock organizationServiceMock, ITracingServiceMock tracingServiceMock) : this(pluginExecutionContextMock, new OrganizationServiceFactoryMock(organizationServiceMock), tracingServiceMock) { }