AppLocatorScope class¶
Defined in
Namespace: Splat.Common.Test
Assembly: Splat.Common.Test.dll
Full name: Splat.Common.Test.AppLocatorScope
Modifiers: public sealed
Summary¶
A scope that saves and restores the AppLocator state for test isolation.
Use in a using statement to ensure proper cleanup.
Applies to
net11.0, net10.0
Class hierarchy
classDiagram
class AppLocatorScope
class IDisposable {
<>
}
IDisposable <|.. AppLocatorScope
Implements: IDisposable
Examples¶
[Test]
public void MyTest()
{
using var scope = new AppLocatorScope();
// Test code here - AppLocator will be reset to a fresh state after the test
}
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [AppLocatorScope](# class. Saves the current AppLocator state and creates a new fresh instance. |
Methods¶
| Name | Summary |
|---|---|
| Dispose | Restores the AppLocator to its previous state. |