Skip to content

Commit

Permalink
cmsdk: Add unit tests for shouldCollapsePanel
Browse files Browse the repository at this point in the history
Change-Id: If9997c1be005f962dc628888f1090cb973588bb4
  • Loading branch information
Adnan Begovic committed Jul 27, 2015
1 parent 3290540 commit 5aa4db2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Expand Up @@ -106,6 +106,15 @@ public void testCustomTileBuilderIconSet() {
assertEquals(resourceInt, customTile.icon);
}

@SmallTest
public void testCustomTileBuilderCollapsePanelSet() {
boolean collapsePanel = true;
CustomTile customTile = new CustomTile.Builder(mContext)
.shouldCollapsePanel(collapsePanel)
.build();
assertEquals(collapsePanel, customTile.collapsePanel);
}

@MediumTest
public void testCustomTileBuilderExpandedListStyleSet() {
PendingIntent intent = PendingIntent.getActivity(mContext, 0,
Expand Down
Expand Up @@ -169,6 +169,25 @@ public void testCustomTileIconUnravelFromParcel() {
assertEquals(expectedCustomTile.icon, fromParcel.icon);
}

@SmallTest
public void testCustomTileCollapsePanelUnravelFromParcel() {
CustomTile expectedCustomTile = new CustomTile.Builder(mContext)
.shouldCollapsePanel(true)
.build();

// Write to parcel
Parcel parcel = Parcel.obtain();
expectedCustomTile.writeToParcel(parcel, 0);

// Rewind
parcel.setDataPosition(0);

// Verify data when unraveling
CustomTile fromParcel = CustomTile.CREATOR.createFromParcel(parcel);

assertEquals(expectedCustomTile.collapsePanel, fromParcel.collapsePanel);
}

@MediumTest
public void testCustomTileExpandedListStyleUnravelFromParcel() {
PendingIntent intent = PendingIntent.getActivity(mContext, 0,
Expand Down

0 comments on commit 5aa4db2

Please sign in to comment.