asContextForAll

infix fun asContextForAll(content: TestFixture.Scope<suspend Value.(testExecutionScope: Test.ExecutionScope) -> Unit>.() -> Unit): TestFixture<Value>(source)

Provides the value from this fixture as a context for all tests declared in the content's scope.

The fixture is implied to be a suite-level fixture. Its value will be instantiated on first use, then shared across tests. It has a lifetime of the suite it was registered in.

Note: As the context for tests in this scope is the fixture's value, the usual Test.ExecutionScope is unavailable as a context. Test.ExecutionScope is, however, provided as a parameter to each test.

Usage:

testFixture {
MyRepository(this)
} asContextForAll {
test("verify score") {
getScore(...) // call a method of MyRepository
}
}