C# Класс TestAutomationEssentials.MSTest.ExecutionContext.TestExecutionScopesManager

Managed nestable scopes of isolation. Upon exit from each scope, it calls the cleanup actions that were registered to it during its lifetime
If you're using MSTest, you should probably use TestBase instead of using this class directly.
Наследование: IIsolationScope
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddCleanupAction ( System.Action action ) : void

Adds a delegate to an action that will be executed on cleanup

BeginIsolationScope ( string isolationScopeName ) : IDisposable

Begins a new, nested, isolation scope

BeginIsolationScope ( string isolationScopeName, Action initialize ) : IDisposable

Begins a new, nested, isolation scope

EndIsolationScope ( ) : void

Ends the current isolation scope, calling all cleanup actions that were added to this scope in reverse order

TestExecutionScopesManager ( string name, Action initialize ) : System

Initializes a new TestExecutionScopesManager object, with one (default) isolation scope

Приватные методы

Метод Описание
CleanupCurrentLevel ( ) : void

Описание методов

AddCleanupAction() публичный Метод

Adds a delegate to an action that will be executed on cleanup
public AddCleanupAction ( System.Action action ) : void
action System.Action A delegate to the action to perform
Результат void

BeginIsolationScope() публичный Метод

Begins a new, nested, isolation scope
public BeginIsolationScope ( string isolationScopeName ) : IDisposable
isolationScopeName string The name of the new isolation scope
Результат IDisposable

BeginIsolationScope() публичный Метод

Begins a new, nested, isolation scope
public BeginIsolationScope ( string isolationScopeName, Action initialize ) : IDisposable
isolationScopeName string The name of the new isolation scope
initialize Action A delegate to an action that is performed on initialization. If an exception occurs inside this /// method, then the scope is automatically destroyed, calling any cleanup actions that were added during this method
Результат IDisposable

EndIsolationScope() публичный Метод

Ends the current isolation scope, calling all cleanup actions that were added to this scope in reverse order
public EndIsolationScope ( ) : void
Результат void

TestExecutionScopesManager() публичный Метод

Initializes a new TestExecutionScopesManager object, with one (default) isolation scope
public TestExecutionScopesManager ( string name, Action initialize ) : System
name string The name of the isolation scope
initialize Action A delegate to an action that is performed on initialization. If an exception occurs inside this /// method, then the scope is automatically destroyed, calling any cleanup actions that were added during this method
Результат System