To create a simple test harness for your plug-ins you just need to create a few classes that implement the IServiceProvider, IOranizationServiceFactory, and IPluginExecutionContext interfaces.
First is the TestServiceProvider Class. This class is responsible for providing the plugin execution context and service factory to the plug-in.
public class TestServiceProvider : IServiceProvider{private TestPluginContext _pluginContext;public TestServiceProvider(TestPluginContext pluginContext){_pluginContext = pluginContext;}
public object GetService(Type serviceType){if (serviceType == typeof(IPluginExecutionContext)){return _pluginContext;}if (serviceType == typeof(IOrganizationServiceFactory)){return new TestServiceFactory();}return null;}}