<PackageReference Include="NUnit" Version="4.3.2" />

SandboxedThreadState

sealed class SandboxedThreadState
Holds thread state which is captured and restored in order to sandbox user code.
public CultureInfo Culture { get; }

public IPrincipal Principal { get; }

Thread principal. This will be null on platforms that don't support CurrentPrincipal.

public CultureInfo UICulture { get; }

public static SandboxedThreadState Capture()

Captures a snapshot of the tracked state of the current thread to be restored later.

public void Restore()

Restores the tracked state of the current thread to the previously captured state.

Returns a copy with the specified culture.

Returns a copy with the specified principal.

Returns a copy with the specified UI culture.