2009/5/4 Jeff Brown <[email protected]>: > > TestLauncher really needs to be refactored at some point. It's doing too > many things and it inadequately abstracts the complexity of what's > underneath. Lots of Law of Demeter violations here. > > Here's how you would use it: > > var fixtureType = typeof(ExampleFixtute); > > var testLauncher = new TestLauncher(); > > testLauncher.RuntimeSetup = new RuntimeSetup(); > > testLauncher.TestRunnerFactoryName = StandardTestRunnerFactoryNames.Local; > > testLauncher.TestPackageConfig.Add(fixtureType.Assembly.Location); > > testLauncher.TestExecutionOptions.FilterSet = > FilterUtils.ParseFilterSet("ExactType:" + fixtureType.FullName); > > TestLauncherResult result = testLauncher.Run(); >
Hi Jeff, thanks for the reply. I've had a go at getting this example working, (using MbUnit 3.0.6) but couldn't see definitions for TestPackageConfig.Add or FilterUtils.ParseFilterSet, but I think this code has the same effect as your example: var fixtureType = typeof(ExampleFixtute); var testLauncher = new TestLauncher(); testLauncher.RuntimeSetup = new RuntimeSetup(); testLauncher.TestRunnerFactoryName = StandardTestRunnerFactoryNames.Local; testLauncher.TestPackageConfig.AssemblyFiles.Add(fixtureType.Assembly.Location); testLauncher.TestExecutionOptions.FilterSet = new FilterSet<ITest>(new TypeFilter<ITest>(new EqualityFilter<string>(fixtureType.FullName), true)); TestLauncherResult result = testLauncher.Run(); This builds, but at runtime I'm getting a "Could not resolve service of type Gallio.Runner.Reports.IReportManager." exception. Do I have to register one myself? How do I get at the Windsor container instance? I guess I'll have to download the source to have a proper look at how this is implemented :-) Cheers, Douglas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MbUnit.User" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/MbUnitUser?hl=en -~----------~----~----~----~------~----~------~--~---
