TestAutomationEssentials.MSTest.ExecutionContext.TestExecutionScopesManager.BeginIsolationScope C# (CSharp) Method

BeginIsolationScope() public method

Begins a new, nested, isolation scope
public BeginIsolationScope ( string isolationScopeName ) : IDisposable
isolationScopeName string The name of the new isolation scope
return IDisposable
        public IDisposable BeginIsolationScope(string isolationScopeName)
        {
            return BeginIsolationScope(isolationScopeName, Functions.EmptyAction<IIsolationScope>());
        }

Same methods

TestExecutionScopesManager::BeginIsolationScope ( string isolationScopeName, Action initialize ) : IDisposable

Usage Example

 public void CanAddCleanupActionAfterOneLevelWasPoppoed()
 {
     var context = new TestExecutionScopesManager("dummy", Functions.EmptyAction<IIsolationScope>());
     context.BeginIsolationScope("Level1", Functions.EmptyAction<IIsolationScope>());
     context.EndIsolationScope();
     var cleanupCalled = false;
     context.AddCleanupAction(() => cleanupCalled = true);
     context.EndIsolationScope();
     Assert.IsTrue(cleanupCalled, "Cleanup action hasn't been called");
 }
All Usage Examples Of TestAutomationEssentials.MSTest.ExecutionContext.TestExecutionScopesManager::BeginIsolationScope