Android Open Source - PhotoPicker Photo Item Layout Test






From Project

Back to project page PhotoPicker.

License

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.

Java Source Code

package com.thuytrinh.photopicker.view;
/*from   w  w w .jav a  2 s  .co m*/
import android.test.AndroidTestCase;

import static org.assertj.android.api.Assertions.assertThat;

public class PhotoItemLayoutTest extends AndroidTestCase {
  public void testShouldInitializeLayoutProperly() {
    PhotoItemLayout itemLayout = new PhotoItemLayout(getContext());

    assertThat(itemLayout).hasChildCount(2);
    assertNotNull(itemLayout.getPhotoView());
    assertNotNull(itemLayout.getCheckMarkView());
    assertThat(itemLayout.getCheckMarkView()).isGone();
  }

  public void testShouldSetCheckedProperly() {
    PhotoItemLayout itemLayout = new PhotoItemLayout(getContext());

    itemLayout.setChecked(false);
    assertThat(itemLayout.getCheckMarkView()).isGone();

    itemLayout.setChecked(true);
    assertThat(itemLayout.getCheckMarkView()).isVisible();
  }

  public void testShouldToggleProperly() {
    PhotoItemLayout itemLayout = new PhotoItemLayout(getContext());

    itemLayout.toggle();
    assertThat(itemLayout.getCheckMarkView()).isVisible();

    itemLayout.toggle();
    assertThat(itemLayout.getCheckMarkView()).isGone();
  }
}




Java Source Code List

com.thuytrinh.photopicker.controller.GroupByBucketIdFunc.java
com.thuytrinh.photopicker.controller.ImageCursorMapperTest.java
com.thuytrinh.photopicker.controller.ImageCursorMapper.java
com.thuytrinh.photopicker.controller.SimpleLoaderListenerTest.java
com.thuytrinh.photopicker.controller.SimpleLoaderListener.java
com.thuytrinh.photopicker.controller.activity.PhotoChooserActivityTest.java
com.thuytrinh.photopicker.controller.activity.PhotoChooserActivity.java
com.thuytrinh.photopicker.controller.adapter.AlbumsAdapter.java
com.thuytrinh.photopicker.controller.adapter.PhotosAdapter.java
com.thuytrinh.photopicker.controller.fragment.AlbumsFragment.java
com.thuytrinh.photopicker.controller.fragment.PhotosFragment.java
com.thuytrinh.photopicker.controller.loader.AlbumsLoaderTest.java
com.thuytrinh.photopicker.controller.loader.AlbumsLoader.java
com.thuytrinh.photopicker.controller.loader.PhotosLoaderTest.java
com.thuytrinh.photopicker.controller.loader.PhotosLoader.java
com.thuytrinh.photopicker.model.PhotoTest.java
com.thuytrinh.photopicker.model.Photo.java
com.thuytrinh.photopicker.module.AppModule.java
com.thuytrinh.photopicker.module.ObjectLocator.java
com.thuytrinh.photopicker.view.AlbumView.java
com.thuytrinh.photopicker.view.PhotoItemLayoutTest.java
com.thuytrinh.photopicker.view.PhotoItemLayout.java