StylePropertyDetails.BORDER_TOP_COLOR,
OptimizerHelper.ANY, PropertyStatus.REQUIRED);
final MutableStylePropertySet propertySet =
new MutableStylePropertySetImpl(); // number of properties
ShorthandAnalyzer analyzer;
// check for null default value
try {
analyzer = new EdgeCharacteristicAnalyzer(
StyleShorthands.BORDER_COLOR, checkerMock, null, shorthandSetMock);
fail();
} catch (IllegalArgumentException e) {
// expected
}
final StyleValue defaultStyleValue =
StyleValueFactory.getDefaultInstance().getColorByRGB(null, 100);
analyzer = new EdgeCharacteristicAnalyzer(
StyleShorthands.BORDER_COLOR, checkerMock, defaultStyleValue,
shorthandSetMock);
analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);
// verify test
// 2 is because of ':' and ';' in getShorthandCost()
assertEquals(StyleShorthands.BORDER_COLOR.getName().length() +
defaultStyleValue.getStandardCost() + 2,
analyzer.getShorthandCost(propertySet, propertySet));
}