Table of Contents

Class TestExecutionContext.IsolatedContext

Namespace
NUnit.Framework.Internal
Assembly
nunit.framework.dll

An IsolatedContext is used when running code that may effect the current result in ways that should not impact the final result of the test. A new TestExecutionContext is created with an initially clear result, which is discarded on exiting the context.

public class TestExecutionContext.IsolatedContext : IDisposable
Inheritance
TestExecutionContext.IsolatedContext
Implements
Inherited Members

Examples

using (new TestExecutionContext.IsolatedContext()) { // Code that should not impact the result }

Constructors

IsolatedContext()

Save the original current TestExecutionContext and make a new isolated context current.

public IsolatedContext()

Methods

Dispose()

Restore the original TestExecutionContext.

public void Dispose()