Add Globals class so we can avoid passing Context through layers of code
If your class requires a Context instance make it a constructor argument. Then create a static factory method that calls Globals.getContext(). The result can then be passed to the constructor. This allows testing individual classes using test doubles by directly invoking the constructor and not having to deal with Globals. For integrated tests spanning multiple classes you might have to use Globals.setContext().
Loading
Please register or sign in to comment