use of com.github.bordertech.wcomponents.WTextField in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testAndOperatorPrecedenceRHS.
/**
* Tests for correct operator precedence when there is an AND on the right-hand side of the OR: a || b
* {@literal &}{@literal &} c.
*/
@Test
public void testAndOperatorPrecedenceRHS() {
builder.equals(new WTextField(), "1").or().equals(new WTextArea(), "2").and().equals(new WDropdown(), "3");
Assert.assertEquals("Incorrect condition", "(WTextField=\"1\" or (WTextArea=\"2\" and WDropdown=\"3\"))", builder.build().toString());
}
use of com.github.bordertech.wcomponents.WTextField in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testAndOperatorPrecedenceLHS.
/**
* Tests for correct operator precedence when there is an AND on the left-hand side of the OR: a
* {@literal &}{@literal &} b || c.
*/
@Test
public void testAndOperatorPrecedenceLHS() {
builder.equals(new WTextField(), "1").and().equals(new WTextArea(), "2").or().equals(new WDropdown(), "3");
Assert.assertEquals("Incorrect condition", "((WTextField=\"1\" and WTextArea=\"2\") or WDropdown=\"3\")", builder.build().toString());
}
use of com.github.bordertech.wcomponents.WTextField in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testBuildGreaterThanOrEquals.
@Test
public void testBuildGreaterThanOrEquals() {
builder.greaterThanOrEquals(new WTextField(), "1");
Assert.assertEquals("Incorrect condition", "WTextField>=\"1\"", builder.build().toString());
}
use of com.github.bordertech.wcomponents.WTextField in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testBuildLessThan.
@Test
public void testBuildLessThan() {
builder.lessThan(new WTextField(), "1");
Assert.assertEquals("Incorrect condition", "WTextField<\"1\"", builder.build().toString());
}
use of com.github.bordertech.wcomponents.WTextField in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testSimpleOneArgCondition.
@Test
public void testSimpleOneArgCondition() {
builder.equals(new WTextField(), "1");
Assert.assertEquals("Incorrect condition", "WTextField=\"1\"", builder.build().toString());
}
Aggregations