Пример #1
0
        public async Task SetPluginSettingsComponent(PluginSettingsComponent component)
        {
            await SettingsLock.WaitAsync();

            _pluginResolver.SetPluginSettingsComponent(component);

            SettingsLock.Release();
        }
Пример #2
0
        public void SetPluginSettingsComponentTest()
        {
            //Arrange
            PluginResolver pluginResolver = new PluginResolver();

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

            var oldComponent = pluginResolver.GetSettingComponent("TestKey");

            var newComponent = new TestSettingsComponent();

            //Act
            pluginResolver.SetPluginSettingsComponent(newComponent);

            //Assert
            Assert.NotEqual(oldComponent, pluginResolver.GetSettingComponent("TestKey"));
            Assert.Equal("TestKey", newComponent.PluginKey);
        }