@Before public void setUp() { MockitoAnnotations.initMocks(this); when(mResources.getString(R.string.media_images_header)).thenReturn("Chief Delphi Photos"); when(mResources.getString(R.string.media_videos_header)).thenReturn("YouTube Videos"); mSubscriber = new MediaListSubscriber(mResources); mMedias = ModelMaker.getModelList(Media.class, "media_frc254_2014"); }
public static <MODEL> List<MODEL> getMultiModelList(Class<MODEL> listClass, String... files) { if (sModelMaker == null) { sModelMaker = new ModelMaker(); } List<MODEL> models = new ArrayList<>(); for (int i = 0; i < files.length; i++) { models.add(sModelMaker.innerGetModel(listClass, files[i])); } return models; }
@Before public void setUp() { Context context = mock(Context.class, RETURNS_DEEP_STUBS); mData = ModelMaker.getModel(JsonObject.class, "notification_event_down"); mNotification = new EventDownNotification(context, mData.toString()); when(context.getString(R.string.notification_event_down)).thenReturn(MOCK_TITLE); when(context.getString(R.string.notification_event_down_content, "Down Event")) .thenReturn(MOCK_TEXT); }
@Before public void setUp() { mDb = mock(Database.class); mTeamListWriter = mock(TeamListWriter.class); mEventTeamListWriter = mock(EventTeamListWriter.class); mTable = DatabaseMocker.mockEventTeamsTable(mDb); mTeamsTable = DatabaseMocker.mockTeamsTable(mDb); List<Team> teams = ModelMaker.getModelList(Team.class, "2015necmp_teams"); mData = new TeamAndEventTeamCombiner("2015necmp").call(teams); mWriter = new EventTeamAndTeamListWriter(mDb, mEventTeamListWriter, mTeamListWriter); }
public static <MODEL> List<MODEL> getModelList(Class<MODEL> listClass, String fileName) { if (sModelMaker == null) { sModelMaker = new ModelMaker(); } return sModelMaker.innerGetModelList(listClass, fileName); }
/** * Gets a model from the given file * * @param modelClass Type of the model * @param fileName Name of the json file (without extension). Relative to src/test/resources * @return Deserialized model */ public static <MODEL> MODEL getModel(Class<MODEL> modelClass, String fileName) { if (sModelMaker == null) { sModelMaker = new ModelMaker(); } return sModelMaker.innerGetModel(modelClass, fileName); }