use of com.android.tools.idea.ui.properties.BindingsManager in project android by JetBrains.
the class DoubleExpressionsTest method testIsEqualExpression.
@Test
public void testIsEqualExpression() {
BoolValueProperty result = new BoolValueProperty();
DoubleValueProperty lhs = new DoubleValueProperty();
DoubleValueProperty rhs = new DoubleValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(result, lhs.isEqualTo(rhs));
assertThat(result.get()).isTrue();
lhs.set(10.0);
assertThat(result.get()).isFalse();
rhs.set(10.0);
assertThat(result.get()).isTrue();
rhs.set(20.0);
assertThat(result.get()).isFalse();
}
use of com.android.tools.idea.ui.properties.BindingsManager in project android by JetBrains.
the class IntExpressionsTest method testGreaterThanValueExpression.
@Test
public void testGreaterThanValueExpression() {
BoolValueProperty result = new BoolValueProperty();
IntValueProperty lhs = new IntValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(result, lhs.isGreaterThan(10));
assertThat(result.get()).isFalse();
lhs.set(10);
assertThat(result.get()).isFalse();
lhs.set(20);
assertThat(result.get()).isTrue();
}
use of com.android.tools.idea.ui.properties.BindingsManager in project android by JetBrains.
the class DoubleExpressionsTest method testGreaterThanExpression.
@Test
public void testGreaterThanExpression() {
BoolValueProperty result = new BoolValueProperty();
DoubleValueProperty lhs = new DoubleValueProperty();
DoubleValueProperty rhs = new DoubleValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(result, lhs.isGreaterThan(rhs));
assertThat(result.get()).isFalse();
lhs.set(10.0);
assertThat(result.get()).isTrue();
rhs.set(10.0);
assertThat(result.get()).isFalse();
}
Aggregations