/// <summary> /// Creates the test harness. /// </summary> /// <param name="testEnvironmentManager">The test environment manager.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="testEnvironmentManager"/> is null.</exception> public TestEnvironmentAwareTestHarness(ITestEnvironmentManager testEnvironmentManager) { if (testEnvironmentManager == null) throw new ArgumentNullException("testEnvironmentManager"); this.testEnvironmentManager = testEnvironmentManager; }
/// <summary> /// Creates the test harness. /// </summary> /// <param name="testEnvironmentManager">The test environment manager.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="testEnvironmentManager"/> is null.</exception> public TestEnvironmentAwareTestHarness(ITestEnvironmentManager testEnvironmentManager) { if (testEnvironmentManager == null) { throw new ArgumentNullException("testEnvironmentManager"); } this.testEnvironmentManager = testEnvironmentManager; }
public PatternTestExecutor(TestExecutionOptions options, IProgressMonitor progressMonitor, IFormatter formatter, IConverter converter, ITestEnvironmentManager environmentManager) { this.options = options; this.progressMonitor = progressMonitor; this.formatter = formatter; this.converter = converter; this.environmentManager = environmentManager; scheduler = new WorkScheduler(() => options.SingleThreaded ? 1 : TestAssemblyExecutionParameters.DegreeOfParallelism); }
/// <summary> /// Creates a pattern test controller. /// </summary> /// <param name="formatter">The formatter for data binding.</param> /// <param name="converter">The converter for data binding.</param> /// <param name="environmentManager">The test environment manager.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="formatter"/>, /// <paramref name="converter"/> or <paramref name="environmentManager"/> is null.</exception> public PatternTestController(IFormatter formatter, IConverter converter, ITestEnvironmentManager environmentManager) { if (formatter == null) throw new ArgumentNullException("formatter"); if (converter == null) throw new ArgumentNullException("converter"); if (environmentManager == null) throw new ArgumentNullException("environmentManager"); this.formatter = formatter; this.converter = converter; this.environmentManager = environmentManager; }
/// <summary> /// Creates a pattern test controller. /// </summary> /// <param name="formatter">The formatter for data binding.</param> /// <param name="converter">The converter for data binding.</param> /// <param name="environmentManager">The test environment manager.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="formatter"/>, /// <paramref name="converter"/> or <paramref name="environmentManager"/> is null.</exception> public PatternTestController(IFormatter formatter, IConverter converter, ITestEnvironmentManager environmentManager) { if (formatter == null) { throw new ArgumentNullException("formatter"); } if (converter == null) { throw new ArgumentNullException("converter"); } if (environmentManager == null) { throw new ArgumentNullException("environmentManager"); } this.formatter = formatter; this.converter = converter; this.environmentManager = environmentManager; }
private static ITestEnvironmentManager ResolveTestEnvironmentManager(ITestEnvironmentManager environmentManager) { return(environmentManager ?? RuntimeAccessor.ServiceLocator.Resolve <ITestEnvironmentManager>()); }
/// <summary> /// Creates a task that will execute code within a new locally running thread /// test thread and a configured test environemnt. /// When the task terminates successfully, its result will contain the value <c>null</c>. /// </summary> /// <param name="name">The name of the task.</param> /// <param name="action">The action to perform within the thread.</param> /// <param name="environmentManager">The test environment manager, or null to use the default environment manager.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="name"/> /// or <paramref name="action"/> is null.</exception> public TestEnvironmentAwareThreadTask(string name, GallioAction action, ITestEnvironmentManager environmentManager) : base(name, action) { this.environmentManager = ResolveTestEnvironmentManager(environmentManager); }
/// <summary> /// Creates a task that will execute code within a new locally running thread /// test thread and a configured test environemnt. /// When the task terminates successfully, its result will contain the value /// returned by <paramref name="func"/>. /// </summary> /// <param name="name">The name of the task.</param> /// <param name="func">The function to perform within the thread.</param> /// <param name="environmentManager">The test environment manager, or null to use the default environment manager.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="name"/> /// or <paramref name="func"/> is null.</exception> public TestEnvironmentAwareThreadTask(string name, GallioFunc <object> func, ITestEnvironmentManager environmentManager) : base(name, func) { this.environmentManager = ResolveTestEnvironmentManager(environmentManager); }
private static ITestEnvironmentManager ResolveTestEnvironmentManager(ITestEnvironmentManager environmentManager) { return environmentManager ?? RuntimeAccessor.ServiceLocator.Resolve<ITestEnvironmentManager>(); }
/// <summary> /// Creates a task that will execute code within a new locally running thread /// test thread and a configured test environemnt. /// When the task terminates successfully, its result will contain the value <c>null</c>. /// </summary> /// <param name="name">The name of the task.</param> /// <param name="action">The action to perform within the thread.</param> /// <param name="environmentManager">The test environment manager, or null to use the default environment manager.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="name"/> /// or <paramref name="action"/> is null.</exception> public TestEnvironmentAwareThreadTask(string name, Action action, ITestEnvironmentManager environmentManager) : base(name, action) { this.environmentManager = ResolveTestEnvironmentManager(environmentManager); }
/// <summary> /// Creates a task that will execute code within a new locally running thread /// test thread and a configured test environemnt. /// When the task terminates successfully, its result will contain the value /// returned by <paramref name="func"/>. /// </summary> /// <param name="name">The name of the task.</param> /// <param name="func">The function to perform within the thread.</param> /// <param name="environmentManager">The test environment manager, or null to use the default environment manager.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="name"/> /// or <paramref name="func"/> is null.</exception> public TestEnvironmentAwareThreadTask(string name, Func<object> func, ITestEnvironmentManager environmentManager) : base(name, func) { this.environmentManager = ResolveTestEnvironmentManager(environmentManager); }