{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
interface ResettingStubber
ResettingStubberImpl |
Implementation of |
A sneaky singleton object used to respond to intents with fake responses. This interface is not meant for public consumption. Test authors should use Intents instead.
Public functions |
|
|---|---|
Unit |
Marks this spy as initialized. |
Boolean |
|
Unit |
reset()Clears state (initialization, expected responses). |
Unit |
setActivityResultForIntent(Sets the result that will be returned to the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched. |
Unit |
setActivityResultFunctionForIntent(Sets a result function that will be called by the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched. |
fun initialize(): Unit
Marks this spy as initialized. Once initialized, ResettingStubber begins recording intents and provides intent stubbing.
fun reset(): Unit
Clears state (initialization, expected responses).
Must be called on main thread.
fun setActivityResultForIntent(
matcher: Matcher<Intent>!,
result: ActivityResult!
): Unit
Sets the result that will be returned to the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched.
fun setActivityResultFunctionForIntent(
matcher: Matcher<Intent>!,
result: ActivityResultFunction!
): Unit
Sets a result function that will be called by the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched.