cmsdk: Add unit tests for shouldCollapsePanel
Change-Id: If9997c1be005f962dc628888f1090cb973588bb4
This commit is contained in:
parent
3290540468
commit
5aa4db2e90
|
@ -106,6 +106,15 @@ public class CustomTileBuilderTest extends AndroidTestCase {
|
|||
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,
|
||||
|
|
|
@ -169,6 +169,25 @@ public class CustomTileTest extends AndroidTestCase {
|
|||
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,
|
||||
|
|
Loading…
Reference in New Issue