Methods Summary |
---|
protected void | setUp()
super.setUp();
mResources = mContext.getResources();
mFailureColor = mResources.getColor(R.color.failColor);
|
public void | testEmptyState()
ColorStateList colorStateList = mResources.getColorStateList(R.color.color1);
int[] emptyState = {};
int defaultColor = colorStateList.getColorForState(emptyState, mFailureColor);
assertEquals(mResources.getColor(R.color.testcolor2), defaultColor);
|
public void | testGetColor()
int defaultColor = mResources.getColor(R.color.color1);
assertEquals(mResources.getColor(R.color.testcolor2), defaultColor);
|
public void | testGetColorWhenListHasNoDefault()
int defaultColor = mResources.getColor(R.color.color_no_default);
assertEquals(mResources.getColor(R.color.testcolor1), defaultColor);
|
public void | testStateIsInList()
ColorStateList colorStateList = mResources.getColorStateList(R.color.color1);
int[] focusedState = {android.R.attr.state_focused};
int focusColor = colorStateList.getColorForState(focusedState, R.color.failColor);
assertEquals(mResources.getColor(R.color.testcolor1), focusColor);
|