use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class LessThan_Test method testToString.
@Test
public void testToString() {
MyTrigger trigger = new MyTrigger();
LessThan compare = new LessThan(trigger, "1");
Assert.assertEquals("Incorrect toString for compare", "MyTrigger<\"1\"", compare.toString());
WLabel label = new WLabel("test label", trigger);
Assert.assertEquals("Incorrect toString for compare with a label", label.getText() + "<\"1\"", compare.toString());
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class Mandatory_Test method testToString.
@Test
public void testToString() {
MyTarget target = new MyTarget();
Mandatory action = new Mandatory(target);
Assert.assertEquals("Incorrect toString for action", "set MyTarget mandatory", action.toString());
WLabel label = new WLabel("test label", target);
Assert.assertEquals("Incorrect toString for action with a label", "set " + label.getText() + " mandatory", action.toString());
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class Match_Test method testToString.
@Test
public void testToString() {
MyTrigger trigger = new MyTrigger();
Match compare = new Match(trigger, "1");
Assert.assertEquals("Incorrect toString for compare", "MyTrigger matches \"1\"", compare.toString());
WLabel label = new WLabel("test label", trigger);
Assert.assertEquals("Incorrect toString for compare with a label", label.getText() + " matches \"1\"", compare.toString());
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class NotEqual_Test method testToString.
@Test
public void testToString() {
MyTrigger trigger = new MyTrigger();
NotEqual compare = new NotEqual(trigger, "1");
Assert.assertEquals("Incorrect toString for compare", "MyTrigger!=\"1\"", compare.toString());
WLabel label = new WLabel("test label", trigger);
Assert.assertEquals("Incorrect toString for compare with a label", label.getText() + "!=\"1\"", compare.toString());
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class CompareExpression_Test method testToString.
@Test
public void testToString() {
SubordinateTrigger trigger = new WTextField();
String value = "test";
// Equal
CompareExpression expr = new CompareExpression(CompareType.EQUAL, trigger, value);
Assert.assertEquals("Incorrect toString for equals compare", "WTextField=\"test\"", expr.toString());
// NotEqual
expr = new CompareExpression(CompareType.NOT_EQUAL, trigger, value);
Assert.assertEquals("Incorrect toString for not equals compare", "WTextField!=\"test\"", expr.toString());
// LessThan
expr = new CompareExpression(CompareType.LESS_THAN, trigger, value);
Assert.assertEquals("Incorrect toString for less than compare", "WTextField<\"test\"", expr.toString());
// LessThanOrEqual
expr = new CompareExpression(CompareType.LESS_THAN_OR_EQUAL, trigger, value);
Assert.assertEquals("Incorrect toString for less than or equal compare", "WTextField<=\"test\"", expr.toString());
// GreaterThan
expr = new CompareExpression(CompareType.GREATER_THAN, trigger, value);
Assert.assertEquals("Incorrect toString for greater than compare", "WTextField>\"test\"", expr.toString());
// GreaterThanOrEqual
expr = new CompareExpression(CompareType.GREATER_THAN_OR_EQUAL, trigger, value);
Assert.assertEquals("Incorrect toString for greater thanor equal compare", "WTextField>=\"test\"", expr.toString());
// Match
expr = new CompareExpression(CompareType.MATCH, trigger, value);
Assert.assertEquals("Incorrect toString for match compare", "WTextField matches \"test\"", expr.toString());
// Test when a label is associated with the field
expr = new CompareExpression(CompareType.EQUAL, trigger, value);
new WLabel("My test field", trigger);
Assert.assertEquals("Incorrect toString for equals compare with label", "My test field=\"test\"", expr.toString());
}
Aggregations