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