public virtual void setup() { controllerProxy = new Mock <IControllerProxy>(); connection = new Mock <IExecutionConnection>(); adapter = new Mock <IExecutionAdapter>(); adapter.Setup(a => a.Connect()).Returns(connection.Object); runner = new ExecutionRunner(testAssemblyPath, controllerProxy.Object, adapter.Object); }
public ITestRunner Create(LaunchOptions options) { string testAssemblyPath = options.DotNet.Project; if (testAssemblyPath == null) { throw new DotNetTestNSpecException("Command line arguments must include path of test project assembly"); } var controllerProxy = proxyFactory.Create(testAssemblyPath); if (!options.DotNet.Port.HasValue) { return(new ConsoleRunner(testAssemblyPath, controllerProxy, options.NSpec)); } ITestRunner runner; if (options.DotNet.List) { var adapter = new DiscoveryAdapter(channelFactory); runner = new DiscoveryRunner(testAssemblyPath, controllerProxy, adapter); } else if (options.DotNet.WaitCommand) { var adapter = new ExecutionAdapter(channelFactory); runner = new ExecutionRunner(testAssemblyPath, controllerProxy, adapter); } else { throw new DotNetTestNSpecException("Design-time command line argument must include either list or wait command options"); } return(runner); }