public void SetupLibraryPlugin(string syneryIdentifier = "Dummy") { LibraryPluginReference simpleDummyReference = new LibraryPluginReference(); simpleDummyReference.SyneryIdentifier = syneryIdentifier; simpleDummyReference.IdPlugin = new Guid("74A8005D-C9F3-455F-94FC-04846493AB7B"); simpleDummyReference.PluginName = "ReferencePluginName"; // activate library plugin instance _LibraryPluginManager.Activate(simpleDummyReference); }
public void Test_All_StaticExtensions_Are_Loaded() { _LibraryPluginManager.Activate(_SimpleDummyReference); // get the first available plugin ILibraryPluginData testLibraryPluginData = (from p in _LibraryPluginManager.AvailablePlugins select p.Value).FirstOrDefault(); // get the expected result // load a list of types from the plugin assebly that implement the IStaticExtension interface Type staticExtensionInterfaceType = typeof(IStaticExtension); var expectedStaticExtensionTypes = from t in Assembly.GetAssembly(typeof(FirstDummyStaticExtension)).GetTypes() where t.IsClass && staticExtensionInterfaceType.IsAssignableFrom(t) select t; Assert.AreEqual(expectedStaticExtensionTypes.Count(), testLibraryPluginData.StaticExtensionContainer.Extensions.Count); }
public void SetupTest() { string solutionDirectoryPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))); _PluginMainDirectoryPath = Path.Combine(solutionDirectoryPath, @"_TestData\InterfaceBooster\LibraryPluginDirectory"); _LibraryPluginManager = new LibraryPluginManager(_PluginMainDirectoryPath); _SimpleDummyReference = LibraryPluginReferenceHelper.GetSimpleDummyReference("First"); // immediately activate the dummy plugin because that isn't part of the test _LibraryPluginManager.Activate(_SimpleDummyReference); }
public void SetupTest() { string solutionDirectoryPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))); _PluginMainDirectoryPath = Path.Combine(solutionDirectoryPath, @"_TestData\InterfaceBooster\LibraryPluginDirectory"); _LibraryPluginRuntimeTestPath = Path.Combine(solutionDirectoryPath, @"_TestData\InterfaceBooster\LibraryPluginRuntimeTest"); _LibraryPluginManager = new LibraryPluginManager(_PluginMainDirectoryPath); _SimpleDummyReference = LibraryPluginReferenceHelper.GetSimpleDummyReference("First"); // immediately activate the dummy plugin because that isn't part of the test _LibraryPluginManager.Activate(_SimpleDummyReference); // the LibraryPluginRuntimeTest-directory is used by the dummy plugin to create some output files that indicates that the call was successfull. // cleanup the LibraryPluginRuntimeTest directory if (Directory.Exists(_LibraryPluginRuntimeTestPath)) { Directory.Delete(_LibraryPluginRuntimeTestPath, true); } Directory.CreateDirectory(_LibraryPluginRuntimeTestPath); }