Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Add name of service in the exception message when a plugin uses a custom service implementation for which there is no default mock #550

Open
jordimontana82 opened this issue Feb 12, 2021 · 0 comments

Comments

@jordimontana82
Copy link
Owner

I currently using FakeXrmEasy with standard Plugins. I works great for me
Now, I would like to integrate with third Party Plugin of which I have the API and Dll to use

for example --> public class ContactUpdateAddress : PluginBase where PluginBase Extends (IPlugin)
the execution method is --> protected override void OnExecute(PluginContext pluginContext) where PluginContext extends ContextBase and context base is defined in this way (below the the extration of the class from object metadata)

What Could I do to integrate FakeXrmEasy with External Third Party Plugin implementation?

using System;
using Microsoft.Xrm.Sdk;
using ThirdParty.CRM.Configuration;
using ThirdParty.Logging;

namespace ThirdParty.CRM
{
public abstract class ContextBase
{
public ContextBase(ILogSource log);
public ContextBase(SourceType sourceType, string sourceName);
protected internal ContextBase();

    public virtual ParameterCollection SharedVariables { get; }
    public virtual ParameterCollection OutputParameters { get; }
    public virtual ParameterCollection InputParameters { get; }
    public abstract IExecutionContext ExecutionContext { get; }
    public abstract Guid UserId { get; }
    public ITracingService TracingService { get; protected set; }
    public IOrganizationServiceFactory OrganizationServiceFactory { get; protected set; }
    public IOrganizationService OrganizationService { get; protected set; }
    public Terna.Localization.Localization Localization { get; protected set; }
    public ILogSource Logger { get; protected set; }
    public Configuration.Configuration Configuration { get; protected set; }
    public IConfigurationProvider ConfigurationProvider { get; protected set; }
    public virtual Guid? TransactionId { get; protected set; }
    public virtual Guid? CorrelationId { get; protected set; }
    public virtual bool IsInTransaction { get; protected set; }
    public ExecutionMode ExecutionMode { get; protected set; }
    public IsolationMode IsolationMode { get; protected set; }

    protected static ExecutionMode GetExecutionModeFromExecutionContext(IExecutionContext executionContext);
    protected static IsolationMode GetIsolationModeFromExecutionContext(IExecutionContext executionContext);
    protected void OnApplyConfigurationToLogger(AdditionalTargetCollection additionalTargets);
    protected virtual void OnLoadConfiguration(IExecutionContext executionContext);
    protected virtual void OnLoadConfigurationProvider();
}

}

Originally posted by @Gmanunta81GFPS in #549

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant