timozattol / project-radin

Project Radin is an expense management Android application that was build during EPFL's Software Engineering 2014 course.
2 stars 2 forks source link

Create a test for the demo #92

Open timozattol opened 9 years ago

timozattol commented 9 years ago

Demo = Opening app, going to MyRadinGroups and seeing multiple radingroups on the screen

radubanabic commented 9 years ago

I suggest using Mockito to mock a certain JSON response from the server; the UI test can then check that a particular list of groups appears on the screen.

Jokau commented 9 years ago

We want to navigate to MyRadinGroupActivity, this activity retrieves the radinGroups from server. Instead of retrieving data from server we want to mock the connection and its return in order to be sure to have always the same radinGroups (names shown) in the activity.

To me, mockito allows to mock objects and test their behaviours but not to replace some code with mock code during the app is running. The only thing that I see could be to re-code all the code that should be executed with Mockito.spy and insert the mock response between. But this seems complicated and I don't think that it is feasible because of the methods (or class) modifiers like protected and private...

Thanks for your help.