ThreadStaticTests DisposingInnerScopeTwiceHasNoEffect Method Delta Engine Documentation

Namespace: DeltaEngine.Tests.Extensions
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void DisposingInnerScopeTwiceHasNoEffect()
Examples

[Test]
public void DisposingInnerScopeTwiceHasNoEffect()
{
    var threadStatic = new ThreadStatic<int>();
    threadStatic.Use(1);
    var innerScope = threadStatic.Use(2);
    Assert.AreEqual(2, threadStatic.Current);
    innerScope.Dispose();
    innerScope.Dispose();
    Assert.AreEqual(1, threadStatic.Current);
}
See Also