Testing an exception is thrown when a contract cannot be resolved