public async Task SetPluginSettingsComponent(PluginSettingsComponent component) { await SettingsLock.WaitAsync(); _pluginResolver.SetPluginSettingsComponent(component); SettingsLock.Release(); }
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); }