Skip to content

Instantly share code, notes, and snippets.

@soudmaijer
Last active February 5, 2018 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soudmaijer/3aee328b64001dc94452b109c461d4f0 to your computer and use it in GitHub Desktop.
Save soudmaijer/3aee328b64001dc94452b109c461d4f0 to your computer and use it in GitHub Desktop.
inline fun expectations(crossinline block: KExpectations.() -> Unit) {
object : KExpectations() {
init {
block()
}
}
}
inline fun verifications(crossinline block: KVerifications.() -> Unit) {
object : KVerifications() {
init {
block()
}
}
}
open class KExpectations : mockit.Expectations() {
public var result: Any? = null
public var any: Any? = null
public var anyString = String()
public var anyLong: Long = 0L
public var anyInt: Int = 0
public var anyShort: Short = 0
public var anyByte: Byte = 0
public var anyBoolean: Boolean = false
public var anyChar: Char = '\u0000'
public var anyDouble: Double = 0.0
public var anyFloat: Float = 0.0f
public var times: Int = 0
public var minTimes: Int = 0
public var maxTimes: Int = 0
}
open class KVerifications : mockit.Verifications() {
public var any: Any? = null
public var anyString = String()
public var anyLong: Long = 0L
public var anyInt: Int = 0
public var anyShort: Short = 0
public var anyByte: Byte = 0
public var anyBoolean: Boolean = false
public var anyChar: Char = '\u0000'
public var anyDouble: Double = 0.0
public var anyFloat: Float = 0.0f
public var times: Int = 0
public var minTimes: Int = 0
public var maxTimes: Int = 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment