示例#1
0
        public void TestLoadAllOfType1()
        {
            using (var scanner = new PluginAssemblyLoader())
            {
                var description = new PluginDescription
                {
                    FilePath = "some nonexistant assembly",
                    PluginImplementations = new List <IPluginImplementationDescription>
                    {
                        new PluginImplementationDescription("Foo1.MyAwesomePlugin", typeof(IFileFormatPlugin))
                    }
                };

                new Action(() => scanner.LoadAllOfType <IFileFormatPlugin>()).ShouldNotThrow();
                scanner.LoadAllOfType <IFileFormatPlugin>().Should().BeEmpty();
            }
        }
示例#2
0
        public void TestLoadAllOfType1()
        {
            using (var scanner = new PluginAssemblyLoader())
            {
                var description = new PluginDescription
                {
                    FilePath = "some nonexistant assembly",
                    Plugins  = new Dictionary <Type, string>
                    {
                        { typeof(IFileFormatPlugin), "Foo1.MyAwesomePlugin" }
                    }
                };

                new Action(() => scanner.LoadAllOfType <IFileFormatPlugin>()).ShouldNotThrow();
                scanner.LoadAllOfType <IFileFormatPlugin>().Should().BeEmpty();
            }
        }