public void SetPluginTileComponentTest() { //Arrange PluginResolver pluginResolver = new PluginResolver(); pluginResolver.AddPlugin(typeof(TestPlugin.TestPlugin), "TestKey"); pluginResolver.LoadPluginTileComponent(typeof(TestTileComponent), "TestTileKey"); var oldComponent = pluginResolver.GetPluginTileComponent("TestKey", "TestTileKey"); oldComponent.Data = new PluginData(); oldComponent.PluginSettings = new PluginData(); var newComponent = new TestTileComponent(); //Act pluginResolver.SetPluginTileComponent("TestTileKey", newComponent); //Assert Assert.NotEqual(oldComponent, pluginResolver.GetPluginTileComponent("TestKey", "TestTileKey")); Assert.Equal(newComponent, pluginResolver.GetPluginTileComponent("TestKey", "TestTileKey")); Assert.Equal("TestKey", newComponent.PluginKey); Assert.Equal("TestTileKey", newComponent.TileKey); Assert.NotNull(newComponent.Data); Assert.NotNull(newComponent.PluginSettings); }
public async Task SetPluginTileComponent(string tileKey, PluginTileComponent component) { await TileLock.WaitAsync(); _pluginResolver.SetPluginTileComponent(tileKey, component); TileLock.Release(); }