interface Builder
Class used to build Mockspresso and Mockspresso.Rule instances.
abstract fun build(): Mockspresso |
|
abstract fun buildRule(): Mockspresso.Rule |
|
abstract fun <T : Any!, V : T> dependency(clazz: Class<T>, value: V?): Mockspresso.Builder abstract fun <T : Any!, V : T> dependency(typeToken: TypeToken<T>, value: V?): Mockspresso.Builder abstract fun <T : Any!, V : T> dependency(key: DependencyKey<T>, value: V?): Mockspresso.Builder
Apply a specific instance of an object as a mockspresso dependency. |
|
abstract fun <T : Any!, V : T> dependencyProvider(clazz: Class<T>, value: ObjectProvider<V>): Mockspresso.Builder abstract fun <T : Any!, V : T> dependencyProvider(typeToken: TypeToken<T>, value: ObjectProvider<V>): Mockspresso.Builder abstract fun <T : Any!, V : T> dependencyProvider(key: DependencyKey<T>, value: ObjectProvider<V>): Mockspresso.Builder
Apply a specific instance of an object as a mockspresso dependency. |
|
abstract fun injector(injectionConfig: InjectionConfig): Mockspresso.Builder
Apply a |
|
abstract fun innerRule(testRule: TestRule): Mockspresso.Builder abstract fun innerRule(methodRule: MethodRule): Mockspresso.Builder
Treat the resulting |
|
abstract fun mocker(mockerConfig: MockerConfig): Mockspresso.Builder
Apply a |
|
abstract fun outerRule(testRule: TestRule): Mockspresso.Builder abstract fun outerRule(methodRule: MethodRule): Mockspresso.Builder
Treat the resulting |
|
abstract fun plugin(plugin: MockspressoPlugin): Mockspresso.Builder
Apply a |
|
abstract fun <T : Any!> realObject(objectClass: Class<T>): Mockspresso.Builder
Instruct mockspresso to create a real object for the provided dependency key. Convenience method, equivalent to calling realObject(DependencyKey.of(objectClass), objectClass); abstract fun <T : Any!> realObject(objectToken: TypeToken<T>): Mockspresso.Builder
Instruct mockspresso to create a real object for the provided dependency key. Convenience method, equivalent to calling realObject(DependencyKey.of(objectToken), objectToken); abstract fun <T : Any!> realObject(keyAndImplementation: DependencyKey<T>): Mockspresso.Builder
Instruct mockspresso to create a real object for the provided dependency key. Convenience method, equivalent to calling realObject(keyAndImplementation, keyAndImplementation.typeToken); abstract fun <T : Any!> realObject(key: DependencyKey<T>, implementationClass: Class<out T>): Mockspresso.Builder abstract fun <T : Any!> realObject(key: DependencyKey<T>, implementationToken: TypeToken<out T>): Mockspresso.Builder
Instruct mockspresso to create a real object (of type implementationClass) for the provided dependency key. |
|
abstract fun specialObjectMaker(specialObjectMaker: SpecialObjectMaker): Mockspresso.Builder
Apply a |
|
abstract fun testResources(objectWithResources: Any): Mockspresso.Builder
Scans the included objectWithResources for fields annotated with @Mock and @RealObject, then prepares them and adds them to our dependency map. Will also call any methods annotated with |
|
abstract fun testResourcesWithoutLifecycle(objectWithResources: Any): Mockspresso.Builder
Scans the included objectWithResources for fields annotated with @Mock and @RealObject, then prepares them and adds them to our dependency map. Mockspresso will not call any methods on objects added via this method. |
fun <T : Any> Mockspresso.Builder.dependencyOf(qualifier: Annotation? = null, value: () -> T?): Mockspresso.Builder
Apply a specific instance of an object as a mockspresso dependency. Kotlin alias for Mockspresso.Builder.dependencyProvider. |
|
fun <BIND_AND_IMPL : Any> Mockspresso.Builder.realClassOf(qualifier: Annotation? = null): Mockspresso.Builder
Instruct mockspresso to create a real object and bind with a dependencyKey of its own concrete type Convenience method for realImplOf when both BIND and IMPL are the same type |
|
fun <BIND : Any, IMPL : BIND> Mockspresso.Builder.realImplOf(qualifier: Annotation? = null): Mockspresso.Builder
Instruct mockspresso to create a real object (of type IMPL) to be bound using a dependency key of type BIND. Kotlin alias for Mockspresso.Builder.realObject |