commonMain.dev.mokkery.MockMany.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mokkery-runtime Show documentation
Show all versions of mokkery-runtime Show documentation
Mokkery is a mocking library for Kotlin Multiplatform, easy to use, boilerplate-free and compiler plugin driven.
The newest version!
@file:Suppress("UNUSED_PARAMETER")
package dev.mokkery
import dev.mokkery.internal.MokkeryPluginNotAppliedException
/**
* Provides mock implementation of [T1] and [T2].
*
* Types restrictions:
* * Each type has to satisfy type restriction from [mock].
* * Only one class is allowed
* * No type duplicates
*/
public inline fun mockMany(
mode: MockMode = MokkeryCompilerDefaults.mockMode,
block: MockMany2.() -> Unit = { }
): MockMany2 = throw MokkeryPluginNotAppliedException()
/**
* Provides mock implementation of [T1], [T2] and [T3].
*
* Types restrictions:
* * Each type has to satisfy type restriction from [mock].
* * Only one class is allowed
* * No type duplicates
*/
public inline fun mockMany(
mode: MockMode = MokkeryCompilerDefaults.mockMode,
block: MockMany3.() -> Unit = { }
): MockMany3 = throw MokkeryPluginNotAppliedException()
/**
* Provides mock implementation of [T1], [T2], [T3] and [T4].
*
* Types restrictions:
* * Each type has to satisfy type restriction from [mock].
* * Only one class is allowed
* * No type duplicates
*/
public inline fun mockMany(
mode: MockMode = MokkeryCompilerDefaults.mockMode,
block: MockMany4.() -> Unit = { }
): MockMany4 = throw MokkeryPluginNotAppliedException()
/**
* Provides mock implementation of [T1], [T2], [T3], [T4] and [T5].
*
* Types restrictions:
* * Each type has to satisfy type restriction from [mock].
* * Only one class is allowed
* * No type duplicates
*/
public inline fun mockMany(
mode: MockMode = MokkeryCompilerDefaults.mockMode,
block: MockMany5.() -> Unit = { }
): MockMany5 = throw MokkeryPluginNotAppliedException()
/**
* Marker interface for mock of [T1] and [T2].
*/
public interface MockMany2
/**
* Marker interface for mock of [T1], [T2] and [T3].
*/
public interface MockMany3 : MockMany2
/**
* Marker interface for mock of [T1], [T2], [T3] and [T4].
*/
public interface MockMany4 : MockMany3
/**
* Marker interface for mock of [T1], [T2], [T3], [T4] and [T5].
*/
public interface MockMany5 : MockMany4
/**
* Casts this as [T1].
*/
public inline val MockMany2.t1: T1 get() = this as T1
/**
* Casts this as [T2].
*/
public inline val MockMany2<*, T2>.t2: T2 get() = this as T2
/**
* Casts this as [T3].
*/
public inline val MockMany3<*, *, T3>.t3: T3 get() = this as T3
/**
* Casts this as [T4].
*/
public inline val MockMany4<*, *, *, T4>.t4: T4 get() = this as T4
/**
* Casts this as [T5].
*/
public inline val MockMany5<*, *, *, *, T5>.t5: T5 get() = this as T5