use of com.android.tools.idea.ui.properties.CountListener in project android by JetBrains.
the class TextPropertyTest method textPropertyCanWrapLabelWithEditLink.
@Test
public void textPropertyCanWrapLabelWithEditLink() {
LabelWithEditLink editLabel = new LabelWithEditLink();
TextProperty textProperty = new TextProperty(editLabel);
CountListener listener = new CountListener();
textProperty.addListener(listener);
assertThat(textProperty.get()).isEqualTo("");
assertThat(listener.getCount()).isEqualTo(0);
editLabel.setText("Edit label set directly");
assertThat(textProperty.get()).isEqualTo("Edit label set directly");
assertThat(listener.getCount()).isEqualTo(1);
textProperty.set("Edit label updated via property");
assertThat(editLabel.getText()).isEqualTo("Edit label updated via property");
assertThat(listener.getCount()).isEqualTo(2);
}
Aggregations