Exemplo n.º 1
0
        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));
 }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
        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));
 }
Exemplo n.º 8
0
 public void ParallelizableAttribute()
 {
     var attr = new ParallelizableAttribute(ParallelScope.Fixtures);
     attr.ApplyToContext(_context);
     Assert.That(_context.ParallelScope, Is.EqualTo(ParallelScope.Fixtures));
 }
Exemplo n.º 9
0
        public void ConstructWithScopeArgument(ParallelScope scope)
        {
            var attr = new ParallelizableAttribute(scope);

            Assert.That(attr.Properties.Get(PropertyNames.ParallelScope), Is.EqualTo(scope));
        }
Exemplo n.º 10
0
        public void DefaultConstructorUsesParallelScopeSelf()
        {
            var attr = new ParallelizableAttribute();

            Assert.That(attr.Properties.Get(PropertyNames.ParallelScope), Is.EqualTo(ParallelScope.Self));
        }