Search in sources :

Example 1 with DoubleValueProperty

use of com.android.tools.idea.ui.properties.core.DoubleValueProperty in project android by JetBrains.

the class DoubleExpressionsTest method testGreaterThanEqualValueExpression.

@Test
public void testGreaterThanEqualValueExpression() {
    BoolValueProperty result = new BoolValueProperty();
    DoubleValueProperty lhs = new DoubleValueProperty();
    BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
    bindings.bind(result, lhs.isGreaterThanEqualTo(10.0));
    assertThat(result.get()).isFalse();
    lhs.set(10.0);
    assertThat(result.get()).isTrue();
    lhs.set(20.0);
    assertThat(result.get()).isTrue();
}
Also used : DoubleValueProperty(com.android.tools.idea.ui.properties.core.DoubleValueProperty) BindingsManager(com.android.tools.idea.ui.properties.BindingsManager) BoolValueProperty(com.android.tools.idea.ui.properties.core.BoolValueProperty) Test(org.junit.Test)

Example 2 with DoubleValueProperty

use of com.android.tools.idea.ui.properties.core.DoubleValueProperty in project android by JetBrains.

the class DoubleExpressionsTest method testLessThanExpression.

@Test
public void testLessThanExpression() {
    BoolValueProperty result = new BoolValueProperty();
    DoubleValueProperty lhs = new DoubleValueProperty();
    DoubleValueProperty rhs = new DoubleValueProperty();
    BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
    bindings.bind(result, lhs.isLessThan(rhs));
    assertThat(result.get()).isFalse();
    rhs.set(10.0);
    assertThat(result.get()).isTrue();
    lhs.set(10.0);
    assertThat(result.get()).isFalse();
}
Also used : DoubleValueProperty(com.android.tools.idea.ui.properties.core.DoubleValueProperty) BindingsManager(com.android.tools.idea.ui.properties.BindingsManager) BoolValueProperty(com.android.tools.idea.ui.properties.core.BoolValueProperty) Test(org.junit.Test)

Example 3 with DoubleValueProperty

use of com.android.tools.idea.ui.properties.core.DoubleValueProperty in project android by JetBrains.

the class DoubleExpressionsTest method testLessThanEqualValueExpression.

@Test
public void testLessThanEqualValueExpression() {
    BoolValueProperty result = new BoolValueProperty();
    DoubleValueProperty lhs = new DoubleValueProperty();
    BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
    bindings.bind(result, lhs.isLessThanEqualTo(10.0));
    assertThat(result.get()).isTrue();
    lhs.set(10.0);
    assertThat(result.get()).isTrue();
    lhs.set(20.0);
    assertThat(result.get()).isFalse();
}
Also used : DoubleValueProperty(com.android.tools.idea.ui.properties.core.DoubleValueProperty) BindingsManager(com.android.tools.idea.ui.properties.BindingsManager) BoolValueProperty(com.android.tools.idea.ui.properties.core.BoolValueProperty) Test(org.junit.Test)

Example 4 with DoubleValueProperty

use of com.android.tools.idea.ui.properties.core.DoubleValueProperty in project android by JetBrains.

the class DoubleExpressionsTest method testLessThanEqualExpression.

@Test
public void testLessThanEqualExpression() {
    BoolValueProperty result = new BoolValueProperty();
    DoubleValueProperty lhs = new DoubleValueProperty();
    DoubleValueProperty rhs = new DoubleValueProperty();
    BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
    bindings.bind(result, lhs.isLessThanEqualTo(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()).isTrue();
}
Also used : DoubleValueProperty(com.android.tools.idea.ui.properties.core.DoubleValueProperty) BindingsManager(com.android.tools.idea.ui.properties.BindingsManager) BoolValueProperty(com.android.tools.idea.ui.properties.core.BoolValueProperty) Test(org.junit.Test)

Example 5 with DoubleValueProperty

use of com.android.tools.idea.ui.properties.core.DoubleValueProperty in project android by JetBrains.

the class DoubleExpressionsTest method testGreaterThanEqualExpression.

@Test
public void testGreaterThanEqualExpression() {
    BoolValueProperty result = new BoolValueProperty();
    DoubleValueProperty lhs = new DoubleValueProperty();
    DoubleValueProperty rhs = new DoubleValueProperty();
    BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
    bindings.bind(result, lhs.isGreaterThanEqualTo(rhs));
    assertThat(result.get()).isTrue();
    rhs.set(10.0);
    assertThat(result.get()).isFalse();
    lhs.set(10.0);
    assertThat(result.get()).isTrue();
    rhs.set(20.0);
    assertThat(result.get()).isFalse();
}
Also used : DoubleValueProperty(com.android.tools.idea.ui.properties.core.DoubleValueProperty) BindingsManager(com.android.tools.idea.ui.properties.BindingsManager) BoolValueProperty(com.android.tools.idea.ui.properties.core.BoolValueProperty) Test(org.junit.Test)

Aggregations

BindingsManager (com.android.tools.idea.ui.properties.BindingsManager)11 DoubleValueProperty (com.android.tools.idea.ui.properties.core.DoubleValueProperty)11 Test (org.junit.Test)11 BoolValueProperty (com.android.tools.idea.ui.properties.core.BoolValueProperty)10