public void GetPlugins_Throws_AssemblyNotFound() { var enumerator = new AssemblyBotPluginEnumerator(AssemblyLoadContext.Default); Assert.Throws <FileNotFoundException>( () => enumerator.GetPlugins(pluginName: "Fake.Assembly.Name").ToList()); }
public void GetPlugins_Throws_InvalidAssemblyName() { var enumerator = new AssemblyBotPluginEnumerator(AssemblyLoadContext.Default); Assert.Throws <FileLoadException>( () => enumerator.GetPlugins(pluginName: "*//\\-_+!?#$").ToList()); }
public void GetPlugins_Throws_ArgumentNullException(string pluginName) { var enumerator = new AssemblyBotPluginEnumerator(AssemblyLoadContext.Default); Assert.Throws <ArgumentNullException>( "pluginName", () => enumerator.GetPlugins(pluginName).ToList()); }
public void GetPlugins_Succeeds() { var enumerator = new AssemblyBotPluginEnumerator(AssemblyLoadContext.Default); IList <IBotPlugin> plugins = enumerator.GetPlugins(Assembly.GetExecutingAssembly().FullName).ToList(); Assert.Equal(3, plugins.Count); Assert.Contains(plugins, p => typeof(PublicBotPlugin) == p.GetType()); Assert.Contains(plugins, p => typeof(AdventureWorksAdapterPlugin) == p.GetType()); Assert.Contains(plugins, p => typeof(ContosoAdapterPlugin) == p.GetType()); }