Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to mock for UI testing? #40

Closed
andretortolano opened this issue Sep 14, 2017 · 3 comments
Closed

How to mock for UI testing? #40

andretortolano opened this issue Sep 14, 2017 · 3 comments

Comments

@andretortolano
Copy link

I'm really confused on how it should work. I'm studying this architecture and converting it to kotling, it seems even tho I can build successfully I cannot get a Mocked instance of API or Preferences helper, what I mean is that I'm trying to mock objects using mockito at ApplicationTestModule but its not replacing the real object from ApplicationModule, I wonder if there is something missing in the flow,... if RuleChain is properly setup in fact. I see the calls from TestComponentRule but

mTestComponent = DaggerTestComponent.builder() .applicationTestModule(ApplicationTestModule(app)) .build()

this is not working

@amitshekhariitbhu
Copy link
Contributor

Is it working for Java?

@andretortolano
Copy link
Author

I'm still trying to mock in your sample, for java my problem is that I cannot mock AppApiHelper. but since I'm receiving Mockito error inside the test provider, I imagine that at least the injection is working properly, I'm trying to see if I can get to the same error using kotlin still..

@andretortolano
Copy link
Author

I'll close the issue since I'm trying a solution in kotlin and also @amitshekhariitbhu pointed out that this is working in java for him, so maybe there is a problem on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants