We have some User with UserRole. I need to verify that the email has been sent to the user with the role 'TestRole'. How can I do that?
List<Messaging.MassEmailMessage.targetobjectids> emails = [SELECT Id FROM User WHERE Id =: createUser('TestRole').Id];
And then use assertEquals. But it's not worked of caurse.