Exemplo n.º 1
0
 public void LoadValidDataReaderPlugin()
 {
     using (var pluginManager = new PluginManager(_pluginsDirectory))
     {
         pluginManager.DeployPluginAsync(_pluginAssemblyPath).Wait();
         Assert.AreEqual(1, pluginManager.Plugins.Count());
     }
 }
Exemplo n.º 2
0
        public void ReadFileUsingLoadedPlugin()
        {
            using (var pluginManager = new PluginManager(_pluginsDirectory))
            {
                pluginManager.DeployPluginAsync(_pluginAssemblyPath).Wait();

                var pluginDescriptors = pluginManager.Plugins.ToArray();
                var entries = pluginDescriptors.FirstOrDefault().Plugin.Read(".\\TestData\\ValidTradeData.xml");

                Assert.AreEqual(2, entries.Length);
            }
        }
Exemplo n.º 3
0
        public void RemovePlugin()
        {
            using (var pluginManager = new PluginManager(_pluginsDirectory))
            {
                var task = pluginManager.DeployPluginAsync(_pluginAssemblyPath);
                task.Wait();

                var pluginDescriptor = pluginManager.Plugins.FirstOrDefault();

                var pluginId = pluginDescriptor.Plugin.Id;
                pluginManager.RemovePluginAsync(pluginId).Wait();

                Assert.IsFalse(File.Exists(Path.Combine(_pluginsDirectory, "Plugin.Xml.dll")));
            }
        }