public void Test4_TypeNotFound() { ITracer tracer = CreateDefaultTracer(); PluginManifest pm = PluginManifest.CreateByText(String.Format("manifest {{\r\n {0}\\Core\\Core.dll {{\r\n plugin=NotFoundPlugin\r\n}}\r\n}}\r\n", PoderosaAppDir())); foreach (StructuredText t in pm.Children) { PluginManifest.AssemblyNode node = pm.LoadAssemblyNode(t); node.TryToBind(tracer); Assert.AreEqual(0, node.PluginTypes.Length); CheckOneErrorMessage(tracer.Document, String.Format(_stringResource.GetString("PluginManager.Messages.TypeLoadError"), node.Assembly.CodeBase, "NotFoundPlugin")); } }
public void Test2_NormalLoad() { ITracer tracer = CreateDefaultTracer(); PluginManifest pm = PluginManifest.CreateByText(String.Format("manifest {{\r\n {0}\\Core\\Core.dll {{\r\n plugin=Poderosa.Preferences.PreferencePlugin\r\n}}\r\n}}\r\n", PoderosaAppDir())); int count = 0; foreach (StructuredText t in pm.Children) { PluginManifest.AssemblyNode node = pm.LoadAssemblyNode(t); node.TryToBind(tracer); Assert.AreEqual(1, node.PluginTypes.Length); //これに失敗するときは型が見つからない Assert.AreEqual("Poderosa.Preferences.PreferencePlugin", node.PluginTypes[0].FullName); count++; } Assert.AreEqual(1, count); //アセンブリ指定は1個しかないので }