public void OneTimeArrangeAct() { try { var testClassType = GetCurrentExecutionTestClassType(); Container = ServicesCollection.Current.CreateChildServicesCollection(testClassType.FullName); Container.RegisterInstance(Container); _currentTestExecutionProvider = new TestWorkflowPluginProvider(); 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; } }
private void ExecuteActArrangePhases() { try { var testClassType = GetCurrentExecutionTestClassType(); if (!TypeForAlreadyExecutedClassInits.Contains(TestContext.FullyQualifiedTestClassName)) { Container = ServicesCollection.Current.CreateChildServicesCollection(testClassType.FullName); Container.RegisterInstance(Container); _currentTestExecutionProvider = new TestWorkflowPluginProvider(); InitializeTestExecutionBehaviorObservers(_currentTestExecutionProvider); TypeForAlreadyExecutedClassInits.Add(TestContext.FullyQualifiedTestClassName); _currentTestExecutionProvider.PreTestsArrange(testClassType); Initialize(); TestsArrange(); _currentTestExecutionProvider.PostTestsArrange(testClassType); _currentTestExecutionProvider.PreTestsAct(testClassType); TestsAct(); _currentTestExecutionProvider.PostTestsAct(testClassType); } } catch (Exception ex) { _currentTestExecutionProvider.TestsArrangeFailed(ex); } }
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); BenchmarkArrange(); _currentBenchmarkExecutionProvider.PostTestsArrange(benchmarkClassType); _currentBenchmarkExecutionProvider.PreTestsAct(benchmarkClassType); BenchmarkAct(); _currentBenchmarkExecutionProvider.PostTestsAct(benchmarkClassType); } } catch (Exception ex) { _currentBenchmarkExecutionProvider.TestsArrangeFailed(ex); } }