public IEnumerable<TestResult> Run(RunSettings settings) { var assembly = getAssembly(settings.Assembly.Assembly); var generator = new LinFu.DynamicProxy.ProxyFactory(); var proxy = new TestListenerProxy(_feedback, settings.Assembly.Assembly); _results = new List<TestResult>(); var mspec = Assembly.LoadFrom("Machine.Specifications.dll"); var type = mspec.GetType("Machine.Specifications.Runner.Impl.AppDomainRunner"); var iTestListener = mspec.GetType("Machine.Specifications.Runner.ISpecificationRunListener"); var dflt = mspec.GetType("Machine.Specifications.Runner.RunOptions").GetProperty("Default").GetValue(null, null); var listener = generator.CreateProxy(iTestListener, proxy, new Type[] {}); var runner = Activator.CreateInstance(type, new object[] {listener, dflt}); runTests(settings, assembly, runner); _results.AddRange(proxy.Results); return _results; }
public IEnumerable <TestResult> Run(RunSettings settings) { var assembly = getAssembly(settings.Assembly.Assembly); var generator = new LinFu.DynamicProxy.ProxyFactory(); var proxy = new TestListenerProxy(_feedback, settings.Assembly.Assembly); _results = new List <TestResult>(); var mspec = Assembly.LoadFrom("Machine.Specifications.dll"); var type = mspec.GetType("Machine.Specifications.Runner.Impl.AppDomainRunner"); var iTestListener = mspec.GetType("Machine.Specifications.Runner.ISpecificationRunListener"); var dflt = mspec.GetType("Machine.Specifications.Runner.RunOptions").GetProperty("Default").GetValue(null, null); var listener = generator.CreateProxy(iTestListener, proxy, new Type[] {}); var runner = Activator.CreateInstance(type, new object[] { listener, dflt }); runTests(settings, assembly, runner); _results.AddRange(proxy.Results); return(_results); }