/// <summary> /// Initialized the class cleanup manager for the unit test runner. Note, this can run over process-isolation, /// and all inputs must be serializable from host process. /// </summary> /// <param name="testsToRun">the list of tests that will be run in this execution</param> /// <param name="classCleanupLifecycle">The assembly level class cleanup lifecycle</param> internal void InitializeClassCleanupManager(ICollection <UnitTestElement> testsToRun, ClassCleanupLifecycle classCleanupLifecycle) { this.classCleanupManager = new ClassCleanupManager( testsToRun, MSTestSettings.CurrentSettings.ClassCleanupLifecycle, classCleanupLifecycle, this.reflectHelper); }
/// <summary> /// Initialized the class cleanup manager for the unit test runner. Note, this can run over process-isolation, /// and all inputs must be serializable from host process. /// </summary> /// <param name="testsToRun">the list of tests that will be run in this execution</param> /// <param name="classCleanupLifecycle">The assembly level class cleanup lifecycle</param> internal void InitializeClassCleanupManager(ICollection <UnitTestElement> testsToRun, int?classCleanupLifecycle) { // We can't transport the enum across AppDomain boundaries because of backwards and forwards compatibility. // So we're converting here if we can, or falling back to the default. var lifecycle = ClassCleanupBehavior.EndOfAssembly; if (classCleanupLifecycle != null && Enum.IsDefined(typeof(ClassCleanupBehavior), classCleanupLifecycle)) { lifecycle = (ClassCleanupBehavior)classCleanupLifecycle; } this.classCleanupManager = new ClassCleanupManager( testsToRun, MSTestSettings.CurrentSettings.ClassCleanupLifecycle, lifecycle, this.reflectHelper); }