public void PluginRuntimeHandler_FetchNamespaceListObject_WhenNullDll_ExpectException() { //------------Setup for test-------------------------- var pluginRuntimeHandler = new PluginRuntimeHandler(); //------------Execute Test--------------------------- pluginRuntimeHandler.FetchNamespaceListObject(null); }
public void PluginRuntimeHandler_FetchNamespaceListObject_WhenNullLocationInSource_ExpectException() { //------------Setup for test-------------------------- var pluginRuntimeHandler = new PluginRuntimeHandler(); var source = CreatePluginSource(true); //------------Execute Test--------------------------- pluginRuntimeHandler.FetchNamespaceListObject(source); }
public void PluginRuntimeHandler_FetchNamespaceListObject_WhenValidDll_ExpectNamespaces() { //------------Setup for test-------------------------- var pluginRuntimeHandler = new PluginRuntimeHandler(); var source = CreatePluginSource(); //------------Execute Test--------------------------- var result = pluginRuntimeHandler.FetchNamespaceListObject(source); //------------Assert Results------------------------- Assert.IsTrue(result.Count > 0); }
public void PluginRuntimeHandler_Run_WhenNullParameters_ExpectException() { //------------Setup for test-------------------------- var svc = CreatePluginService(); var source = CreatePluginSource(); var pluginRuntimeHandler = new PluginRuntimeHandler(); PluginInvokeArgs args = new PluginInvokeArgs { AssemblyLocation = source.AssemblyLocation, AssemblyName = "Foo", Fullname = svc.Namespace, Method = svc.Method.Name, Parameters = null }; //------------Execute Test--------------------------- pluginRuntimeHandler.Run(args); }
public void PluginRuntimeHandler_ListNamespaces_WhenInvalidLocation_ExpectNoResults() { //------------Setup for test-------------------------- var pluginRuntimeHandler = new PluginRuntimeHandler(); //------------Execute Test--------------------------- var result = pluginRuntimeHandler.ListNamespaces("z:\foo\asm.dll", "Foo"); Assert.IsFalse(result.Any()); }
public void PluginRuntimeHandler_Run_WhenValidLocation_ExpectResult() { //------------Setup for test-------------------------- var svc = CreatePluginService(); var source = CreatePluginSource(); var pluginRuntimeHandler = new PluginRuntimeHandler(); PluginInvokeArgs args = new PluginInvokeArgs { AssemblyLocation = source.AssemblyLocation, AssemblyName = "Foo", Fullname = svc.Namespace, Method = svc.Method.Name, Parameters = svc.Method.Parameters }; //------------Execute Test--------------------------- var result = pluginRuntimeHandler.Run(args); var castResult = result as DummyClassForPluginTest; //------------Assert Results------------------------- if(castResult != null) { StringAssert.Contains(castResult.Name, "test data"); } else { Assert.Fail("Failed Conversion for Assert"); } }
public void PluginRuntimeHandler_ListNamespaces_WhenValidLocation_ExpectNamespaces() { //------------Setup for test-------------------------- var pluginRuntimeHandler = new PluginRuntimeHandler(); var source = CreatePluginSource(); //------------Execute Test--------------------------- var result = pluginRuntimeHandler.ListNamespaces(source.AssemblyLocation, "Foo"); //------------Assert Results------------------------- Assert.IsTrue(result.Any()); }
public void PluginRuntimeHandler_ListNamespaces_WhenNullLocation_ExpectException() { //------------Setup for test-------------------------- var pluginRuntimeHandler = new PluginRuntimeHandler(); //------------Execute Test--------------------------- pluginRuntimeHandler.ListNamespaces(null, "Foo"); }
public void PluginRuntimeHandler_ValidatePlugin_WhenNullDll_ExpectErrorMessage() { //------------Setup for test-------------------------- var pluginRuntimeHandler = new PluginRuntimeHandler(); //------------Execute Test--------------------------- pluginRuntimeHandler.ValidatePlugin(null); }
public void PluginRuntimeHandler_ValidatePlugin_WhenInvalidGacDll_ExpectErrorMessage() { //------------Setup for test-------------------------- var pluginRuntimeHandler = new PluginRuntimeHandler(); //------------Execute Test--------------------------- var result = pluginRuntimeHandler.ValidatePlugin("GAC:mscorlib_foo, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); //------------Assert Results------------------------- StringAssert.Contains(result, "Could not load file or assembly 'mscorlib_foo"); }
public void PluginRuntimeHandler_ValidatePlugin_WhenGacDll_ExpectBlankMessage() { //------------Setup for test-------------------------- var pluginRuntimeHandler = new PluginRuntimeHandler(); //------------Execute Test--------------------------- var result = pluginRuntimeHandler.ValidatePlugin("GAC:mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); //------------Assert Results------------------------- StringAssert.Contains(result, string.Empty); }
public void PluginRuntimeHandler_ValidatePlugin_WhenNotADll_ExpectErrorMessage() { //------------Setup for test-------------------------- var pluginRuntimeHandler = new PluginRuntimeHandler(); var source = CreatePluginSource(); //------------Execute Test--------------------------- var result = pluginRuntimeHandler.ValidatePlugin(source.AssemblyLocation + ".foo"); //------------Assert Results------------------------- StringAssert.Contains(result, "Not a Dll file"); }
public void PluginRuntimeHandler_ValidatePlugin_WhenValidDll_ExpectBlankMessage() { //------------Setup for test-------------------------- var pluginRuntimeHandler = new PluginRuntimeHandler(); var source = CreatePluginSource(); //------------Execute Test--------------------------- var result = pluginRuntimeHandler.ValidatePlugin(source.AssemblyLocation); //------------Assert Results------------------------- StringAssert.Contains(result, string.Empty); }