Ejemplo n.º 1
0
        bool FindTestsForMethod(ITestMethod testMethod,
                                TestMethodDisplay defaultMethodDisplay,
                                bool includeSourceInformation,
                                IMessageBus messageBus)
        {
            var observationAttribute = testMethod.Method.GetCustomAttributes(typeof(FactAttribute)).FirstOrDefault();

            if (observationAttribute == null)
            {
                return(true);
            }

            var testCase = new ObservationTestCase(defaultMethodDisplay, testMethod);

            var skipReason = GetSkipReason(observationAttribute);

            if (!string.IsNullOrWhiteSpace(skipReason))
            {
                var skipTestCase = new SkippedTestCase(defaultMethodDisplay, testMethod);
                skipTestCase.SetSkipReason(skipReason);
                testCase = skipTestCase;
            }

            if (!ReportDiscoveredTestCase(testCase, includeSourceInformation, messageBus))
            {
                return(false);
            }

            return(true);
        }
        bool FindTestsForMethod(ITestMethod testMethod,
                                TestMethodDisplay defaultMethodDisplay,
                                bool includeSourceInformation,
                                IMessageBus messageBus)
        {
            var observationAttribute = testMethod.Method.GetCustomAttributes(typeof(FactAttribute)).FirstOrDefault(); 
            if (observationAttribute == null)
                return true;

            var testCase = new ObservationTestCase(defaultMethodDisplay, testMethod);

            var skipReason = GetSkipReason(observationAttribute);
            if (!string.IsNullOrWhiteSpace(skipReason))
            {
                var skipTestCase = new SkippedTestCase(defaultMethodDisplay, testMethod);
                skipTestCase.SetSkipReason(skipReason);
                testCase = skipTestCase;
            }
            
            if (!ReportDiscoveredTestCase(testCase, includeSourceInformation, messageBus))
                return false;

            return true;
        }
Ejemplo n.º 3
0
 public ObservationTest(ObservationTestCase testCase, string displayName)
 {
     TestCase    = testCase;
     DisplayName = displayName;
 }
Ejemplo n.º 4
0
 public ObservationTest(ObservationTestCase testCase, string displayName)
 {
     TestCase = testCase;
     DisplayName = displayName;
 }