Example #1
0
        public async Task <PluginPageComponent> GetMainPage(Type pluginType)
        {
            await PageLock.WaitAsync();

            var mainPage = _pluginResolver.GetMainPage(pluginType);

            PageLock.Release();

            return(mainPage);
        }
Example #2
0
        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());
        }