WindowSdkExtensionsRule


class WindowSdkExtensionsRule : TestRule


TestRule for overriding WindowSdkExtensions properties in unit tests.

The TestRule is designed to only be used in unit tests. Users should use the actual WindowSdkExtensions properties for instrumentation tests. Overriding the device's extensions version to a higher version may lead to unexpected test failures or even app crash.

Summary

Public constructors

Public functions

open Statement
apply(base: Statement, description: Description)
Unit
overrideExtensionVersion(version: @IntRange(from = 0) Int)

Overrides the WindowSdkExtensions.extensionVersion for testing.

Public constructors

WindowSdkExtensionsRule

Added in 1.4.0-alpha05
WindowSdkExtensionsRule()

Public functions

apply

Added in 1.4.0-alpha05
open fun apply(base: Statement, description: Description): Statement

overrideExtensionVersion

Added in 1.4.0-alpha05
fun overrideExtensionVersion(version: @IntRange(from = 0) Int): Unit

Overrides the WindowSdkExtensions.extensionVersion for testing.

Parameters
version: @IntRange(from = 0) Int

The extension version to override.