TestServiceLocator

@VisibleForTesting
object TestServiceLocator

An object for setting up the test environment when using the simple-scaffold.

Its register method should be called in a test setup function (e.g., a method annotated with @Before in JUnit4) to initialize the MainServiceLocator with a test-specific instance that can provide mocks.

Properties

Link copied to clipboard

Provides convenient access to the registered test locator instance. Useful for registering fakes directly within a test method.

Functions

Link copied to clipboard
fun register(mockFactory: MockFactory? = null, registrationBlock: SimpleServiceLocator<ServiceLocatorScope>.() -> Unit = {})

Initializes and registers a service locator for tests.