public IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute)
        {
            TestParameters parameters = new TestParameters(factAttribute);
            List<IXunitTestCase> cases = _theoryDiscoverer.Discover(discoveryOptions, testMethod, factAttribute).AsList();

            if (parameters.ThreadType == ThreadType.UI)
            {
                return cases.Select(c => new XunitMainThreadTestCaseDecorator(c)).ToList();
            }

            return cases.Select(c => new XunitTestCaseDecorator(c)).ToList();
        }
Ejemplo n.º 2
0
        public IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute)
        {
            TestParameters parameters = new TestParameters(factAttribute);
            IXunitTestCase testCase = _factDiscoverer.Discover(discoveryOptions, testMethod, factAttribute).Single();

            if (parameters.ThreadType == ThreadType.UI)
            {
                yield return new XunitMainThreadTestCaseDecorator(testCase);
            }
            else
            {
                yield return new XunitTestCaseDecorator(testCase);
            }
        }
Ejemplo n.º 3
0
 protected override IXunitTestCase CreateTestCaseForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo theoryAttribute, object[] dataRow) {
     var parameters = new TestParameters(testMethod, theoryAttribute);
     return new TestCase(_diagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), testMethod, parameters, dataRow);
 }
Ejemplo n.º 4
0
 protected override IXunitTestCase CreateTestCase(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute) {
     var parameters = new TestParameters(testMethod, factAttribute);
     return new TestCase(_diagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), testMethod, parameters);
 }
Ejemplo n.º 5
0
 public TestForTypesTestCase(IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, ITestMethod testMethod, TestParameters parameters, Type testMethodArgumentType)
     : base(diagnosticMessageSink, defaultMethodDisplay, testMethod, parameters, new object[] { testMethodArgumentType }) {
 }
Ejemplo n.º 6
0
 public TestCase(IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, ITestMethod testMethod, TestParameters parameters, object[] testMethodArguments = null) 
     : base(diagnosticMessageSink, defaultMethodDisplay, testMethod, testMethodArguments) {
     ThreadType = parameters.ThreadType;
 }
Ejemplo n.º 7
0
        protected override IXunitTestCase CreateTestCase(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute)
        {
            var parameters = new TestParameters(testMethod, factAttribute);

            return(new TestCase(_diagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), testMethod, parameters));
        }