Open davigonz opened 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are sure that this issue is important and should not be marked as stale
just ask to put an important
label.
Hi @oleksiyp, is this bug when we try to mock "Intent" also?
I had a problem like that...
I have tried making a spyk<Intent>()
and returning a default value from the method getIntExtra
, the behavior has been returning the value 0.
Note: I would like to test the call's intent.getIntExtra("MY_KEY", 10)
and ensure that default value was 10.
@Test
fun `Test if the default value is 10`() {
// WHEN
val id = intent.getIntExtra("MY_KEY", 10)
// THEN
Assert.assertEquals(10, id)
}
Hi here, before starting with the explanation, I would like to mention that the same code with Mockito works as expected.
Expected Behavior
The intent spy is properly built and activity launched.
Current Behavior
The intent used to launch an activity raises an error.
Steps to Reproduce
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Stack trace
Minimal reproducible code (the gist of this issue)