public void GetPluginPagesTest() { //Arrange PluginResolver pluginResolver = new PluginResolver(); pluginResolver.AddPlugin(typeof(TestPlugin.TestPlugin), "TestKey"); pluginResolver.LoadPluginPages(typeof(TestPlugin.TestPlugin)); //Act var pages = pluginResolver.GetPluginPages("TestKey").ToList(); //Assert Assert.Equal(2, pages.Count); Assert.Equal(2, pages.Count(page => page.PluginKey == "TestKey")); //make sure the right amount of pages are in the list Assert.Single(pages.Where(tile => tile.GetType() == typeof(TestPage))); Assert.Single(pages.Where(tile => tile.GetType() == typeof(MainTestPage))); }
public void LoadPluginPagesTest() { //Arrange PluginResolver pluginResolver = new PluginResolver(); pluginResolver.AddPlugin(typeof(TestPlugin.TestPlugin), "TestKey"); //Act pluginResolver.LoadPluginPages(typeof(TestPlugin.TestPlugin)); //Assert var plugin = pluginResolver.GetPlugin(typeof(TestPlugin.TestPlugin)); Assert.Equal(2, plugin.PluginPages.Count); //make sure the page instance is not null Assert.NotNull(plugin.PluginPages.First().Value.Item1); //we only load the IPage so the component SHOULD be null Assert.Null(plugin.PluginPages.First().Value.Item2); Assert.Equal("TestKey", plugin.PluginPages.First().Value.Item1.PluginKey); }
private void LoadPluginPages(Type pluginType) { _pluginResolver.LoadPluginPages(pluginType); }