// text, we don't know exact value, but know format
assertThat(getPropertyText(sizeProperty)).contains("(").contains(",").contains(")");
}
public void test_sizeProperty_setSize() throws Exception {
Property sizeProperty = getSizeProperty("button.setSize('10cm', '20mm');");
assertTrue(sizeProperty.getCategory().isSystem());
// value for this property is always "null"
assertNull(sizeProperty.getValue());
// we have "setSize()" invocation, so property is modified
assertTrue(sizeProperty.isModified());
// text
assertEquals("(10cm, 20mm)", getPropertyText(sizeProperty));
// setValue() does nothing
{
String expectedSource = m_lastEditor.getSource();
sizeProperty.setValue(null);
assertEditor(expectedSource, m_lastEditor);
}
// sub-properties
{
Property[] subProperties = getSubProperties(sizeProperty);
// check "width"
{
Property widthProperty = subProperties[0];
assertEquals("width", widthProperty.getTitle());
assertTrue(widthProperty.isModified());
assertEquals("10cm", widthProperty.getValue());
// reset width
setSizeProperty(widthProperty, Property.UNKNOWN_VALUE);
assertEditor(getSizeSource("button.setHeight('20mm');"), m_lastEditor);
// restore width
setSizeProperty(widthProperty, "5in");
assertEditor(getSizeSource("button.setSize('5in', '20mm');"), m_lastEditor);
}
// check "height"
{
Property heightProperty = subProperties[1];
assertEquals("height", heightProperty.getTitle());
assertTrue(heightProperty.isModified());
assertEquals("20mm", heightProperty.getValue());
// reset width
setSizeProperty(heightProperty, Property.UNKNOWN_VALUE);
assertEditor(getSizeSource("button.setWidth('5in');"), m_lastEditor);
// restore width
setSizeProperty(heightProperty, "2cm");