### Question:
SqlQueryParser implements QueryParser { protected PropertyValue parsePropertyValue( TokenStream tokens, TypeSystem typeSystem, Source source ) { Position pos = tokens.nextPosition(); String firstWord = parseName(tokens, typeSystem); SelectorName selectorName = null; if (tokens.canConsume('.')) { selectorName = new SelectorName(firstWord); String propertyName = parseName(tokens, typeSystem); return propertyValue(selectorName, propertyName); } if (source instanceof Selector) { selectorName = ((Selector)source).aliasOrName(); return propertyValue(selectorName, firstWord); } String msg = GraphI18n.mustBeScopedAtLineAndColumn.text(firstWord, pos.getLine(), pos.getColumn()); throw new ParsingException(pos, msg); }  String getLanguage(); @Override String toString(); @Override boolean equals( Object obj ); QueryCommand parseQuery( String query,
                                    TypeSystem typeSystem ); static final String LANGUAGE; }### Answer:
@Test( expected = ParsingException.class ) public void shouldFailToDynamicOperandValueFromStringWithOnlyPropertyNameIfSourceIsNotSelector() { parser.parsePropertyValue(tokens("property"), typeSystem, mock(Join.class)); }
@Test( expected = ParsingException.class ) public void shouldFailToParseDynamicOperandFromStringWithOnlySelectorNameAndPeriod() { parser.parsePropertyValue(tokens("tableA. "), typeSystem, mock(Join.class)); }
@Test public void shouldParsePropertyValueFromStringWithUnquotedSelectorNameAndUnquotedPropertyName() { PropertyValue value = parser.parsePropertyValue(tokens("tableA.property"), typeSystem, mock(Join.class)); assertThat(value.propertyName(), is("property")); assertThat(value.selectorName(), is(selectorName("tableA"))); }
@Test public void shouldParsePropertyValueFromStringWithQuotedSelectorNameAndUnquotedPropertyName() { PropertyValue value = parser.parsePropertyValue(tokens("[mode:tableA].property"), typeSystem, mock(Join.class)); assertThat(value.propertyName(), is("property")); assertThat(value.selectorName(), is(selectorName("mode:tableA"))); }
@Test public void shouldParsePropertyValueFromStringWithQuotedSelectorNameAndQuotedPropertyName() { PropertyValue value = parser.parsePropertyValue(tokens("[mode:tableA].[mode:property]"), typeSystem, mock(Join.class)); assertThat(value.propertyName(), is("mode:property")); assertThat(value.selectorName(), is(selectorName("mode:tableA"))); }
@Test public void shouldParsePropertyValueFromStringWithOnlyPropertyNameIfSourceIsSelector() { Source source = new NamedSelector(selectorName("tableA")); PropertyValue value = parser.parsePropertyValue(tokens("property"), typeSystem, source); assertThat(value.propertyName(), is("property")); assertThat(value.selectorName(), is(selectorName("tableA"))); }
@Test( expected = ParsingException.class ) public void shouldFailToParsePropertyValueFromStringWithOnlyPropertyNameIfSourceIsNotSelector() { parser.parsePropertyValue(tokens("property"), typeSystem, mock(Join.class)); }
@Test( expected = ParsingException.class ) public void shouldFailToParsePropertyValueFromStringWithOnlySelectorNameAndPeriod() { parser.parsePropertyValue(tokens("tableA. "), typeSystem, mock(Join.class)); }