You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class MyTest {
@Rule [...DaggerMockRule with MyComponent...]
@InjectFromComponent @Dog Animal a1;
@InjectFromComponent @Cat Animal a2;
fun `test inject from component with qualifier` {
assertTrue(a1 is Dog)
assertTrue(a2 is Cat)
}
}
The second assert will fail as a2 is again a Dog. In MyComponent I'm correctly exposing both Animal with their respective qualifiers. It seems that here the first method encountered which expose the type Animal will return, thus leading to the defect.
This doesn't seem to happen when using DaggerMockRule setter without using InjectFromComponent
Am I wrong? Thank you so much for your help, good job!
The text was updated successfully, but these errors were encountered:
Hi, you are right, this use case wasn't supported. But it was quite simple to add the code to support it, can you try to use the commit version db3a68609a?
Many thanks for your report
Hi Fabio!
I'm trying to do something like this:
The second assert will fail as
a2
is again a Dog. In MyComponent I'm correctly exposing bothAnimal
with their respective qualifiers. It seems that here the first method encountered which expose the typeAnimal
will return, thus leading to the defect.This doesn't seem to happen when using DaggerMockRule setter without using
InjectFromComponent
Am I wrong? Thank you so much for your help, good job!
The text was updated successfully, but these errors were encountered: