Skip to content

Controlling mock behaviour from test cases #2

Description

@bobthekingofegypt

Could we have an example of how we would create various mock responses for different test cases against an activity.

In-keeping with the flubolate terminolgy by that I mean if we were testing MainActivity and wanted to verify the behaviour if the flumbolate threw an error, or returned null. Currently the behaviour of the mock is defined in the module.

How could we prep the mocks before telling robolectric to run the activity startup so we can vary their outcomes? Should we mark the flumbolate as singleton and inject it into the test class somehow?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions