Пример #1
0
        public async Task InitializeSettings()
        {
            foreach (var pluginSettingsComponent in _pluginResolver.GetSettingComponents())
            {
                var plugin = _pluginManager.GetPluginInstance(pluginSettingsComponent);

                pluginSettingsComponent.PluginKey    = plugin.Key;
                pluginSettingsComponent.SettingsData = await _pluginSettingsManager.GetPluginSettings(plugin.Key);
            }
        }
Пример #2
0
        public void GetSettingComponentsTest()
        {
            //Arrange
            PluginResolver pluginResolver = new PluginResolver();

            pluginResolver.AddPlugin(typeof(TestPlugin.TestPlugin), "TestKey");
            pluginResolver.LoadPluginSettingsComponent(typeof(TestSettingsComponent), null);

            //Act
            var settingsComponents = pluginResolver.GetSettingComponents().ToList();

            //Assert
            Assert.NotNull(settingsComponents);
            Assert.Single(settingsComponents);
        }