Do not rely on exceptions for control flow in ResolvesVariable method.
AssignVariable overwrites existing one
Small adjustment in the test