MockspressoInstance

interface MockspressoInstance

A fully-constructed instance of a Mockspresso dependency map.

Functions

Link copied to clipboard
abstract fun buildUpon(): MockspressoBuilder

Returns a new MockspressoBuilder using this Mockspresso instance as a parent.

Link copied to clipboard
abstract fun <T> createNow(key: DependencyKey<T>): T

Create a new real object using the rules and dependencies in the mockspresso instance.

Link copied to clipboard
abstract fun <T> findNow(key: DependencyKey<T>): T

Find an existing dependency in this mockspresso instance. If the dependency hasn't been cached or constructed then it will be generated on the fly and cached from that point forward. If the binding hasn't been declared in this mockspresso instance, then a fallback will be generated.

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
inline fun <T> MockspressoInstance.createNow(qualifier: Annotation? = null): T

Create a new real object of type T using the rules and dependencies in the mockspresso instance.

Link copied to clipboard
inline fun <T> MockspressoInstance.findNow(qualifier: Annotation? = null): T

Find an existing dependency in this mockspresso instance of type T with the provided qualifier. If the dependency hasn't been cached or constructed then it will be generated on the fly and cached from that point forward. If the binding hasn't been declared in this mockspresso instance, then a fallback will be generated.