use of com.android.tools.idea.ui.properties.core.BoolValueProperty in project android by JetBrains.
the class BooleanExpressionsTest method testNotExpression.
@Test
public void testNotExpression() throws Exception {
BoolValueProperty srcValue = new BoolValueProperty(true);
BoolValueProperty destValue = new BoolValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(destValue, BooleanExpressions.not(srcValue));
assertThat(srcValue.get()).isTrue();
assertThat(destValue.get()).isFalse();
srcValue.set(false);
assertThat(srcValue.get()).isFalse();
assertThat(destValue.get()).isTrue();
}
use of com.android.tools.idea.ui.properties.core.BoolValueProperty in project android by JetBrains.
the class DoubleExpressionsTest method testGreaterThanValueExpression.
@Test
public void testGreaterThanValueExpression() {
BoolValueProperty result = new BoolValueProperty();
DoubleValueProperty lhs = new DoubleValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(result, lhs.isGreaterThan(10.0));
assertThat(result.get()).isFalse();
lhs.set(10.0);
assertThat(result.get()).isFalse();
lhs.set(20.0);
assertThat(result.get()).isTrue();
}
use of com.android.tools.idea.ui.properties.core.BoolValueProperty in project android by JetBrains.
the class DoubleExpressionsTest method testLessThanValueExpression.
@Test
public void testLessThanValueExpression() {
BoolValueProperty result = new BoolValueProperty();
DoubleValueProperty lhs = new DoubleValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(result, lhs.isLessThan(10.0));
assertThat(result.get()).isTrue();
lhs.set(10.0);
assertThat(result.get()).isFalse();
lhs.set(20.0);
assertThat(result.get()).isFalse();
}
use of com.android.tools.idea.ui.properties.core.BoolValueProperty in project android by JetBrains.
the class DoubleExpressionsTest method testIsEqualWithValueExpression.
@Test
public void testIsEqualWithValueExpression() {
BoolValueProperty result = new BoolValueProperty();
DoubleValueProperty lhs = new DoubleValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(result, lhs.isEqualTo(10));
assertThat(result.get()).isFalse();
lhs.set(10.0);
assertThat(result.get()).isTrue();
lhs.set(20.0);
assertThat(result.get()).isFalse();
}
use of com.android.tools.idea.ui.properties.core.BoolValueProperty in project android by JetBrains.
the class IntExpressionsTest method testLessThanValueExpression.
@Test
public void testLessThanValueExpression() {
BoolValueProperty result = new BoolValueProperty();
IntValueProperty lhs = new IntValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(result, lhs.isLessThan(10));
assertThat(result.get()).isTrue();
lhs.set(10);
assertThat(result.get()).isFalse();
lhs.set(20);
assertThat(result.get()).isFalse();
}
Aggregations