public void ParallelizableAttribute() { var attr = new ParallelizableAttribute(ParallelScope.Fixtures); attr.ApplyToContext(_context); Assert.That(_context.ParallelScope, Is.EqualTo(ParallelScope.Fixtures)); }
public void ApplyScopeToContext(ParallelScope scope) { var context = new TestExecutionContext(); var attr = new ParallelizableAttribute(scope); attr.ApplyToContext(context); Assert.That(context.ParallelScope, Is.EqualTo(scope & ParallelScope.ContextMask)); }
public void ApplyScopeToTest(ParallelScope scope) { var test = new TestDummy(); var attr = new ParallelizableAttribute(scope); attr.ApplyToTest(test); Assert.That(test.Properties.Get(PropertyNames.ParallelScope), Is.EqualTo(scope)); }
public void MayNotUseParallelScopeFixturesOnTestMethod() { var test = TestBuilder.MakeTestCase(GetType(), nameof(DummyMethod)); var attr = new ParallelizableAttribute(ParallelScope.Fixtures); attr.ApplyToTest(test); Assert.That(test.RunState, Is.EqualTo(RunState.NotRunnable)); }
public void MayNotCombineParallelScopeSelfAndParallelScopeNone() { var fixture = new TestFixture(new TypeWrapper(typeof(FixtureClass))); var attr = new ParallelizableAttribute(ParallelScope.Self | ParallelScope.None); attr.ApplyToTest(fixture); Assert.That(fixture.RunState, Is.EqualTo(RunState.NotRunnable)); }
public void OkToUseParallelScopeChildrenOnParameterizedTestMethod() { var test = TestBuilder.MakeParameterizedMethodSuite(GetType(), nameof(DummyTestCase)); var attr = new ParallelizableAttribute(ParallelScope.Children); attr.ApplyToTest(test); Assert.That(test.RunState, Is.EqualTo(RunState.Runnable)); }
public void ApplyScopeToTestFixture(ParallelScope scope) { var fixture = new TestFixture(new TypeWrapper(typeof(FixtureClass))); var attr = new ParallelizableAttribute(scope); attr.ApplyToTest(fixture); if (scope == ParallelScope.Fixtures) scope |= ParallelScope.Self; Assert.That(fixture.Properties.Get(PropertyNames.ParallelScope), Is.EqualTo(scope)); }
public void ParallelizableAttribute() { var attr = new ParallelizableAttribute(ParallelScope.Fixtures); attr.ApplyToContext(_context); Assert.That(_context.ParallelScope, Is.EqualTo(ParallelScope.Fixtures)); }
public void ConstructWithScopeArgument(ParallelScope scope) { var attr = new ParallelizableAttribute(scope); Assert.That(attr.Properties.Get(PropertyNames.ParallelScope), Is.EqualTo(scope)); }
public void DefaultConstructorUsesParallelScopeSelf() { var attr = new ParallelizableAttribute(); Assert.That(attr.Properties.Get(PropertyNames.ParallelScope), Is.EqualTo(ParallelScope.Self)); }