createOrNull

inline fun <T : Any> MockFactory.createOrNull(noinline block: MokkeryMockConfigurer.Block<T> = { }): T?(source)

Creates a mock of given T and applies the block or returns null if T is not supported by this factory.


inline fun <T : Any> SpyFactory.createOrNull(obj: T, noinline block: MokkerySpyConfigurer.Block<T> = { }): T?(source)

Creates a spy of given T wrapping obj and applies the block or returns null if T is not supported by this factory.