예제 #1
0
 public void ThrowsIfTypeDoesNotHaveDefaultConstructor()
 {
     PluginLoader loader = new PluginLoader();
     AssemblyName assemblyName = GetType().Assembly.GetName();
     string typeName = typeof(PluginWithNoDefaultConstructor).FullName;
     loader.Load(assemblyName, typeName);
 }
예제 #2
0
 public void ThrowsIfTypeIsNotCompatibleWithNoise()
 {
     PluginLoader loader = new PluginLoader();
     AssemblyName assemblyName = GetType().Assembly.GetName();
     string typeName = GetType().FullName;
     loader.Load(assemblyName, typeName);
 }
예제 #3
0
 public void ThrowsIfAssemblyNotFound()
 {
     PluginLoader loader = new PluginLoader();
     AssemblyName assemblyName = new AssemblyName("OMG u deleted teh asembly u nubcake");
     string typeName = typeof(DelayPlugin).FullName;
     loader.Load(assemblyName, typeName);
 }
예제 #4
0
 public void ThrowsIfPluginTypeNotFoundInAssembly()
 {
     PluginLoader loader = new PluginLoader();
     AssemblyName assemblyName = typeof(DelayPlugin).Assembly.GetName();
     string typeName = "Sorry, you're not my type";
     loader.Load(assemblyName, typeName);
 }
예제 #5
0
        public void LoadsPluginGivenAssemblyNameAndType()
        {
            PluginLoader loader = new PluginLoader();
            AssemblyName assemblyName = typeof(DelayPlugin).Assembly.GetName();
            string typeName = typeof(DelayPlugin).FullName;
            INoisePlugin plugin = loader.Load(assemblyName, typeName);

            Assert.IsTrue(plugin is DelayPlugin);
        }