private ITestRunner CreateTestRunner(TestRunnerKey key) { var container = TestRunContainerBuilder.CreateContainer(); if (key.Async) { //TODO: better support this in the DI container container.RegisterTypeAs<AsyncTestRunner, ITestRunner>(); } var factory = container.Resolve<ITestRunnerFactory>(); return factory.Create(key.TestAssembly); }
public bool Equals(TestRunnerKey other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.TestAssembly, TestAssembly) && other.Async.Equals(Async)); }
private ITestRunner CreateTestRunner(TestRunnerKey key) { var container = TestRunContainerBuilder.CreateContainer(); if (key.Async) { //TODO: better support this in the DI container container.RegisterTypeAs <AsyncTestRunner, ITestRunner>(); } var factory = container.Resolve <ITestRunnerFactory>(); return(factory.Create(key.TestAssembly)); }
private ITestRunner GetTestRunner(TestRunnerKey key) { ITestRunner testRunner; if (!testRunnerRegistry.TryGetValue(key, out testRunner)) { lock(syncRoot) { if (!testRunnerRegistry.TryGetValue(key, out testRunner)) { testRunner = CreateTestRunner(key); testRunnerRegistry.Add(key, testRunner); } } } return testRunner; }
private ITestRunner GetTestRunner(TestRunnerKey key) { ITestRunner testRunner; if (!testRunnerRegistry.TryGetValue(key, out testRunner)) { lock (syncRoot) { if (!testRunnerRegistry.TryGetValue(key, out testRunner)) { testRunner = CreateTestRunner(key); testRunnerRegistry.Add(key, testRunner); } } } return(testRunner); }
public bool Equals(TestRunnerKey other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.TestAssembly, TestAssembly) && other.Async.Equals(Async); }