Ejemplo n.º 1
0
 public StressTest(StressTestAttribute attr,
             MethodInfo testMethodInfo,
             MethodInfo globalSetupMethod,
             MethodInfo globalCleanupMethod,
             Type type,
             List<MethodInfo> setupMethods,
             List<MethodInfo> cleanupMethods,
             MethodInfo globalExceptionHandlerMethod)
     : base(attr, testMethodInfo, type, setupMethods, cleanupMethods)
 {
     _attr = attr;
     _globalSetupMethod = globalSetupMethod;
     _globalCleanupMethod = globalCleanupMethod;
     _globalExceptionHandlerMethod = globalExceptionHandlerMethod;
 }
Ejemplo n.º 2
0
 public StressTest(StressTestAttribute attr,
                   MethodInfo testMethodInfo,
                   MethodInfo globalSetupMethod,
                   MethodInfo globalCleanupMethod,
                   Type type,
                   List <MethodInfo> setupMethods,
                   List <MethodInfo> cleanupMethods,
                   MethodInfo globalExceptionHandlerMethod)
     : base(attr, testMethodInfo, type, setupMethods, cleanupMethods)
 {
     _attr = attr;
     _globalSetupMethod            = globalSetupMethod;
     _globalCleanupMethod          = globalCleanupMethod;
     _globalExceptionHandlerMethod = globalExceptionHandlerMethod;
 }
Ejemplo n.º 3
0
        private static bool MatchFilter(StressTestAttribute attr)
        {
            // This change should not have impacts on any existing tests.
            //    1. If filter is not provided in command line, we do not apply filter and select all the tests.
            //    2. If current test attribute (such as StressTestAttribute) does not implement ITestAttriuteFilter, it is not affected and still selected.

            if (string.IsNullOrEmpty(TestMetrics.Filter))
            {
                return(true);
            }

            var filter = attr as ITestAttributeFilter;

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

            return(filter.MatchFilter(TestMetrics.Filter));
        }
Ejemplo n.º 4
0
        private static bool MatchFilter(StressTestAttribute attr)
        {
            // This change should not have impacts on any existing tests. 
            //    1. If filter is not provided in command line, we do not apply filter and select all the tests.
            //    2. If current test attribute (such as StressTestAttribute) does not implement ITestAttriuteFilter, it is not affected and still selected.

            if (string.IsNullOrEmpty(TestMetrics.Filter))
            {
                return true;
            }

            var filter = attr as ITestAttributeFilter;
            if (filter == null)
            {
                return true;
            }

            return filter.MatchFilter(TestMetrics.Filter);
        }