dependency

inline fun <T> MockspressoBuilder.dependency(qualifier: Annotation? = null, noinline provider: () -> T): MockspressoBuilder

Register a dependency provided by provider, bound in the mockspresso graph with a dependencyKey made from type T and qualifier.


inline fun <T> MockspressoProperties.dependency(qualifier: Annotation? = null, noinline provider: () -> T): Lazy<T>

Register a dependency provided by provider, bound in the mockspresso graph with a dependencyKey made from type T and qualifier.

Returns a Lazy with access to that dependency.

IMPORTANT: Reading the value from the returned lazy will cause the underlying MockspressoInstance to be ensured if it hasn't been already.