public InitializeContext ( TestExecutionContext context ) : void | ||
context | TestExecutionContext | The TestExecutionContext to use |
Результат | void |
public void CreateWorkItems() { IMethodInfo method = new MethodWrapper(typeof(DummyFixture), "DummyTest"); ITest test = new TestMethod(method); _workItem = WorkItem.CreateWorkItem(test, TestFilter.Empty); _context = new TestExecutionContext(); _workItem.InitializeContext(_context); }
public void CreateWorkItems() { IMethodInfo method = new MethodWrapper(typeof(DummyFixture), "DummyTest"); ITest test = new TestMethod(method); _workItem = WorkItemBuilder.CreateWorkItem(test, TestFilter.Empty); _context = new TestExecutionContext(); _workItem.InitializeContext(_context); }
public void CreateWorkItems() { FixtureMethod method = typeof(DummyFixture).GetFixtureMethod("DummyTest"); ITest test = new TestMethod(method); _workItem = WorkItemBuilder.CreateWorkItem(test, TestFilter.Empty); _context = new TestExecutionContext(); _workItem.InitializeContext(_context); }
public void ParallelExeutionStrategy_TestFixture(ParallelScope testScope, ParallelScope contextScope, string expectedStrategy) { _testFixture.Properties.Set(PropertyNames.ParallelScope, testScope); _context.ParallelScope = contextScope; WorkItem work = WorkItem.CreateWorkItem(_testFixture, TestFilter.Empty); work.InitializeContext(_context); // We use a string for expected because the ExecutionStrategy enum is internal and can't be an arg to a public method Assert.That(ParallelWorkItemDispatcher.GetExecutionStrategy(work).ToString(), Is.EqualTo(expectedStrategy)); }
public void ParallelExecutionStrategy_TestCase(ParallelScope testScope, ParallelScope contextScope, string expectedStrategy) { _testMethod.Properties.Set(PropertyNames.ParallelScope, testScope); _context.ParallelScope = contextScope; WorkItem work = WorkItem.CreateWorkItem(_testMethod, TestFilter.Empty); work.InitializeContext(_context); // We use a string for expected because the ExecutionStrategy enum is internal and can't be an arg to a public method Assert.That(ParallelWorkItemDispatcher.GetExecutionStrategy(work).ToString(), Is.EqualTo(expectedStrategy)); // Make context single threaded - should always be direct _context.IsSingleThreaded = true; Assert.That(ParallelWorkItemDispatcher.GetExecutionStrategy(work).ToString(), Is.EqualTo("Direct")); }