fun <T> any(): T
Mockito matcher that matches anything, including nulls and varargs. |
|
fun <T> eq(value: T): T
Mockito matcher that matches if the argument is the same as the provided value. |
|
fun <T : Throwable> expectException(clazz: KClass<T>, block: () -> Unit): Unit
Expect block to throw an exception. Otherwise fail the test (junit). |
|
fun <T : Any> mock(): T
Dynamically create a mock object. This method is helpful when creating mocks of classes using generics. |
|
fun mockMotionEvent(action: Int, downTime: Long = System.currentTimeMillis(), eventTime: Long = System.currentTimeMillis(), x: Float = 0f, y: Float = 0f, metaState: Int = 0): MotionEvent
Creates a custom MotionEvent for testing. As of SDK 28 MotionEvents can't be mocked anymore and need to be created through MotionEvent.obtain. |