MockFactory
Creates a mock implementation for given type.
Unlike dev.mokkery.mock, which requires the mocked type to be known at compile time, a factory creates mocks from a KType resolved at runtime.
Use mockFactoryOf to create an instance of it.
Functions
Link copied to clipboard
abstract fun copy(newScope: MokkeryScope? = null, block: MockFactoryConfigurer.Block = { }): MockFactory
Copies a factory with given configuration block applied.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T : Any> MockFactory.createOrNull(noinline block: MokkeryMockConfigurer.Block<T> = { }): T?
Link copied to clipboard
Returns a MockFactory that combines this factory with other.