Пример #1
0
        public void OneTimeArrangeAct()
        {
            try
            {
                var testClassType = GetCurrentExecutionTestClassType();

                Container = ServicesCollection.Current.CreateChildServicesCollection(testClassType.FullName);
                Container.RegisterInstance(Container);
                _currentTestExecutionProvider = new PluginProvider();
                Initialize();
                InitializeTestExecutionBehaviorObservers(_currentTestExecutionProvider);
                _currentTestExecutionProvider.PreTestsArrange(testClassType);
                TestsArrange();
                _currentTestExecutionProvider.PostTestsArrange(testClassType);
                _currentTestExecutionProvider.PreTestsAct(testClassType);
                TestsAct();
                _currentTestExecutionProvider.PostTestsAct(testClassType);
            }
            catch (Exception ex)
            {
                _currentTestExecutionProvider.TestsArrangeFailed(ex);

                throw ex;
            }
        }
Пример #2
0
 private void ExecuteActArrangePhases()
 {
     try
     {
         var testClassType = GetCurrentExecutionTestClassType();
         if (!TypeForAlreadyExecutedClassInits.Contains(TestContext.FullyQualifiedTestClassName))
         {
             Container = ServicesCollection.Current.CreateChildServicesCollection(testClassType.FullName);
             Container.RegisterInstance(Container);
             _currentTestExecutionProvider = new PluginProvider();
             InitializeTestExecutionBehaviorObservers(_currentTestExecutionProvider);
             TypeForAlreadyExecutedClassInits.Add(TestContext.FullyQualifiedTestClassName);
             _currentTestExecutionProvider.PreTestsArrange(testClassType, new List <object>());
             Initialize();
             TestsArrange();
             _currentTestExecutionProvider.PostTestsArrange(testClassType);
             _currentTestExecutionProvider.PreTestsAct(testClassType, new List <object>());
             TestsAct();
             _currentTestExecutionProvider.PostTestsAct(testClassType, new List <object>());
         }
     }
     catch (Exception ex)
     {
         _currentTestExecutionProvider.TestsArrangeFailed(ex);
     }
 }
Пример #3
0
 public void OneTimeArrangeAct()
 {
     try
     {
         var testClassType = TestClassType;
         Container = ServicesCollection.Current.CreateChildServicesCollection(testClassType.FullName);
         Container.RegisterInstance(Container);
         _currentTestExecutionProvider = new PluginProvider();
         InitializeTestExecutionBehaviorObservers(_currentTestExecutionProvider);
         MethodInfo testMethodMemberInfo = null;
         _currentTestExecutionProvider.PreTestsArrange(testClassType, new List <object>());
         TestsArrange();
         _currentTestExecutionProvider.PostTestsArrange(testClassType);
         _currentTestExecutionProvider.PreTestsAct(testClassType, new List <object>());
         TestsAct();
         _currentTestExecutionProvider.PostTestsAct(testClassType, new List <object>());
     }
     catch (Exception ex)
     {
         _currentTestExecutionProvider.TestsArrangeFailed(ex);
     }
 }
Пример #4
0
        public void CoreExecuteActArrangePhases()
        {
            try
            {
                var stackTrace = new StackTrace();
                var benchmarkMethodMemberInfo = stackTrace.GetFrame(1).GetMethod() as MethodInfo;
                var benchmarkClassType        = benchmarkMethodMemberInfo?.DeclaringType;

                if (!TypeForAlreadyExecutedBenchmarkInits.Contains(benchmarkClassType?.FullName))
                {
                    TypeForAlreadyExecutedBenchmarkInits.Add(benchmarkClassType?.FullName);
                    _currentBenchmarkExecutionProvider.PreTestsArrange(benchmarkClassType, new List <object>());
                    BenchmarkArrange();
                    _currentBenchmarkExecutionProvider.PostTestsArrange(benchmarkClassType);
                    _currentBenchmarkExecutionProvider.PreTestsAct(benchmarkClassType, new List <object>());
                    BenchmarkAct();
                    _currentBenchmarkExecutionProvider.PostTestsAct(benchmarkClassType, new List <object>());
                }
            }
            catch (Exception ex)
            {
                _currentBenchmarkExecutionProvider.TestsArrangeFailed(ex);
            }
        }