public void GetPlugins_ValidPluggablesEmptyAssembliesNull_RaiseArgumentNullException() { // arrange ILogManager lmMock = this.CreateLogManagerMock(); PluginsConfigXml config = this.CreatePluginsConfigMock(); PluginManager pm = new PluginManager( lmMock, config ); IList<Type> pluggables = new List<Type>(); IList<Assembly> pluginAssemblies = null; Dictionary<Type, IList<Attribute>> plugins = null; // act plugins = pm.GetPlugins( pluggables, pluginAssemblies ); // assert }
public void GetPlugins_ValidPluggablesEmptyValidAssembliesEmpty_0Plugins() { // arrange ILogManager lmMock = this.CreateLogManagerMock(); PluginsConfigXml config = this.CreatePluginsConfigMock(); PluginManager pm = new PluginManager( lmMock, config ); IList<Type> pluggables = new List<Type>(); IList<Assembly> pluginAssemblies = new List<Assembly>(); Dictionary<Type, IList<Attribute>> plugins = null; // act plugins = pm.GetPlugins( pluggables, pluginAssemblies ); // assert Assert.IsNotNull( plugins ); Assert.AreEqual( 0, plugins.Count ); }
public void GetPlugins_TwoPluggablesOneAssembly_2PluginTypes2TestPluggableOne1TestPlugggableTwo() { // arrange ILogManager lmMock = this.CreateLogManagerMock(); PluginsConfigXml config = this.CreatePluginsConfigMock(); PluginManager pm = new PluginManager( lmMock, config ); IList<Type> pluggables = new List<Type>() { typeof( TestPluggableOne ), typeof( TestPluggableTwo ) }; IList<Assembly> pluginAssemblies = new List<Assembly>() { Assembly.GetExecutingAssembly() }; Dictionary<Type, IList<Attribute>> plugins = null; // act plugins = pm.GetPlugins( pluggables, pluginAssemblies ); // assert Assert.IsNotNull( plugins ); Assert.AreEqual( 2, plugins.Count ); Assert.AreEqual( 2, plugins[ typeof( TestPluggableOne ) ].Count ); Assert.AreEqual( 1, plugins[ typeof( TestPluggableTwo ) ].Count ); }