Test programmer call mbunit Programmatically

I am currently creating a test suite using mbunit. So far so good, but instead of using the included Icarus GUI, I want to have my own test runner. Not knowing what to do, I go to the Google Gallio group and copy the code sent by the user:

http://groups.google.com/group/gallio-user/browse_thread/thread/afab404a14674cd2

And instead, I got the following exception:

Gallio.Runtime.RuntimeException error was unhandled Message = Failed to resolve component for service type "Gallio.Runner.Projects.ITestProjectManager" because there are apparently no components registered and enabled for this type of service. Source = Gallio Stack Traces: in Gallio.Runtime.Extensibility.RegistryServiceLocator.ResolveNonDisabledDescriptor (type serviceType) in Gallio.Runtime.Extensibility.RegistryServiceLocator.Resolve.plestreterviceviceTerreerviceRestorerreterviceRestorterreterviceRestorerreterviceRestorerreterviceRestorerretervice. .RunWithRuntime () in Gallio.Runner.TestLauncher.Run () in Dundas.Dashboard.TestSystem.TestPrograms.Driver.RunTests () in C: \ Users \ edmondc \ Documents \ Visual Studio 2010 \ Projects \ AutomatedTestSystem \ TestPrograms \ ImageComparisonTest Driver.cs: line 49 in Dundas.Dashboard.TestSystem.Program.Main (String [] args) in C: \ Users \ edmondc \ Documents \ Visual Studio 2010 \ Projects \ AutomatedTestSystem \ TestConsole \ Program.cs: line 13 in System .AppDomain._nExecuteAssembly (assembly RuntimeAssembly, String [] args) in System.AppDomain.ExecuteAssembly (String assemblyFile, Evidence assemblySecurity, St ring [] args) in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly () in System.Threading.ThreadHelper.ThreadStart_Context (object state) in System.Threading.ExecutionContext.Run (ExecutionContext executeContext, object callback ContextCallbackcore, call state ) in System.Threading.ExecutionContext.Run (ExecutionContext executeContext, ContextCallback callback, object state) in System.Threading.ThreadHelper.ThreadStart () InnerException:

What am I doing wrong there?

+6
source share
1 answer

You can use the Gallio Loader , which can be found somewhere in the Gallio installation directory. The loader is provided as a pair of C # source files that you need to include in your project. Its goal is to facilitate the integration of Gallio in user applications.

A simple use is as follows:

TestLauncher launcher = new TestLauncher(); launcher.AddFilePattern("MyTestAssembly.dll"); TestLauncherResult result = launcher.Run(); 

EDIT . For more complex use of the test launcher, check out the source code for Echo .

+7
source

Source: https://habr.com/ru/post/895276/


All Articles