use of com.android.tools.idea.ui.properties.core.IntProperty in project android by JetBrains.
the class ExpressionTest method testSimpleExpression.
@Test
public void testSimpleExpression() throws Exception {
final IntProperty intValue = new IntValueProperty(13);
final Expression<String> intToString = new Expression<String>(intValue) {
@NotNull
@Override
public String get() {
return intValue.get().toString();
}
};
assertThat(intToString.get()).isEqualTo("13");
intValue.set(-13);
assertThat(intToString.get()).isEqualTo("-13");
}
use of com.android.tools.idea.ui.properties.core.IntProperty in project android by JetBrains.
the class OptionalExpressionsTest method testAsOptionalExpression.
@Test
public void testAsOptionalExpression() {
IntProperty intProperty = new IntValueProperty(42);
AsOptionalExpression<Integer> asOptionalExpr = new AsOptionalExpression<>(intProperty);
assertThat(asOptionalExpr.get().get()).isEqualTo(42);
intProperty.set(123);
assertThat(asOptionalExpr.get().get()).isEqualTo(123);
}
Aggregations