public async Task <PluginPageComponent> GetMainPage(Type pluginType) { await PageLock.WaitAsync(); var mainPage = _pluginResolver.GetMainPage(pluginType); PageLock.Release(); return(mainPage); }
public void GetMainPageTest() { //Arrange PluginResolver pluginResolver = new PluginResolver(); pluginResolver.AddPlugin(typeof(TestPlugin.TestPlugin), "TestKey"); pluginResolver.LoadPluginPageComponent(typeof(TestPageComponent)); pluginResolver.LoadPluginPageComponent(typeof(MainTestPageComponent)); //Act var mainPage = pluginResolver.GetMainPage(typeof(TestPlugin.TestPlugin)); //Assert Assert.NotNull(mainPage); Assert.Equal(typeof(MainTestPageComponent), mainPage.GetType()); }