use of com.trovebox.android.app.PhotoDetailsActivity.PhotoDetailsUiFragment in project mobile-android by photo.
the class PhotoDetailsActivityTest method testPreconditions.
public void testPreconditions() throws JSONException, ClientProtocolException, IllegalStateException, IOException {
// Setup mock calls and their responses
PowerMock.reset(getApiMock());
getApiMock().getPhoto((String) EasyMock.anyObject(), (ReturnSizes) EasyMock.anyObject(), (String) EasyMock.anyObject(), (String) EasyMock.anyObject());
PowerMock.expectLastCall().andReturn(new PhotoResponse(RequestType.UNKNOWN, JSONUtils.getJson(getInstrumentation().getContext(), R.raw.json_photo_get))).times(2);
PowerMock.replayAll();
Intent intent = new Intent();
Photo photo = Photo.fromJson(JSONUtils.getJson(getInstrumentation().getContext(), R.raw.json_photo));
intent.putExtra(PhotoDetailsUiFragment.EXTRA_PHOTO, photo);
setActivityIntent(intent);
activity = this.getActivity();
Fragment fragment = activity.getSupportFragmentManager().findFragmentById(android.R.id.content);
Assert.assertNotNull(fragment);
Assert.assertTrue(fragment instanceof PhotoDetailsUiFragment);
}
Aggregations