Skip to content

PlatformModeDetectorScope class

Defined in

Namespace: Splat.Common.Test Assembly: Splat.Common.Test.dll Full name: Splat.Common.Test.PlatformModeDetectorScope Modifiers: public sealed

Summary

View source

        A scope that saves and restores the PlatformModeDetector state for test isolation.
        Use in a using statement to ensure proper cleanup.
        

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net471

Class hierarchy
classDiagram
class PlatformModeDetectorScope
class IDisposable {
    <>
}
IDisposable <|.. PlatformModeDetectorScope

Implements: IDisposable

Examples

[Test]
 public void MyTest()
 {
 using var scope = new PlatformModeDetectorScope();
 // Test code here - PlatformModeDetector will be reset to fresh state after the test
 }

Constructors

NameSummary
.ctorInitializes a new instance of the [PlatformModeDetectorScope](# class. Saves the current PlatformModeDetector state and resets it to default.

Methods

NameSummary
DisposeRestores the PlatformModeDetector to its previous state.
Inherited members