Raises error if expected method is not invoked