Back to project page PhotoPicker.
The source code is released under:
GNU General Public License
If you think the Android project PhotoPicker listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.thuytrinh.photopicker.controller.loader; //from w w w . j a v a 2 s. c om import android.database.Cursor; import android.provider.MediaStore; import android.test.AndroidTestCase; import com.thuytrinh.photopicker.module.ObjectLocator; import org.assertj.android.api.Assertions; import dagger.ObjectGraph; import static org.assertj.core.api.Assertions.assertThat; public class AlbumsLoaderTest extends AndroidTestCase { private AlbumsLoader mAlbumListLoader; public void testShouldInitializeProperly() { Assertions.assertThat(mAlbumListLoader) .hasProjection( MediaStore.Images.Media._ID, MediaStore.Images.Media.BUCKET_ID, MediaStore.Images.Media.BUCKET_DISPLAY_NAME, MediaStore.Images.Media.DATA) .hasUri(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); } public void testShouldLoadProperly() { Cursor cursor = mAlbumListLoader.loadInBackground(); assertThat(cursor.getCount()) .isGreaterThan(0); Assertions.assertThat(cursor) .hasColumns( MediaStore.Images.Media._ID, MediaStore.Images.Media.BUCKET_ID, MediaStore.Images.Media.BUCKET_DISPLAY_NAME, MediaStore.Images.Media.DATA) .isBeforeFirst(); } @Override protected void setUp() throws Exception { super.setUp(); ObjectGraph objectGraph = ObjectLocator.getGraph(getContext()); mAlbumListLoader = objectGraph.get(AlbumsLoader.class); } }