コード例 #1
0
        public void Should_return_all_plugins_of_the_specified_type()
        {
            var plugin1 = Plugin <IPluginType> .Create(new Plugin1());

            var plugin2 = Plugin <IPluginType> .Create(new Plugin1());

            var plugin3 = Plugin <IPluginType> .Create <Plugin1>();

            _plugins.Append(Plugin <IPluginType> .Create(new Plugin2()));
            _plugins.Append(plugin1);
            _plugins.Append(plugin2);
            _plugins.Append(Plugin <IPluginType> .Create <Plugin3>());
            _plugins.Append(plugin3);

            _plugins.AllOfType(typeof(Plugin1)).ShouldOnlyContain(plugin1, plugin2, plugin3);
        }