@Test
public void shouldParseDynamicOperandFromStringContainingUpperOfAnotherDynamicOperand() {
DynamicOperand operand = parser.parseDynamicOperand(tokens("UPPER(tableA.property)"), typeSystem, mock(Source.class));
assertThat(operand, is(instanceOf(UpperCase.class)));
UpperCase upper = (UpperCase)operand;
assertThat(upper.selectorName(), is(selectorName("tableA")));
assertThat(upper.getOperand(), is(instanceOf(PropertyValue.class)));
PropertyValue value = (PropertyValue)upper.getOperand();
assertThat(value.getPropertyName(), is("property"));
assertThat(value.selectorName(), is(selectorName("tableA")));
Source source = new NamedSelector(selectorName("tableA"));
operand = parser.parseDynamicOperand(tokens("UPPER(property)"), typeSystem, source);
assertThat(operand, is(instanceOf(UpperCase.class)));
upper = (UpperCase)operand;
assertThat(upper.selectorName(), is(selectorName("tableA")));
assertThat(upper.getOperand(), is(instanceOf(PropertyValue.class)));
value = (PropertyValue)upper.getOperand();
assertThat(value.getPropertyName(), is("property"));
assertThat(value.selectorName(), is(selectorName("tableA")));
}