I'm trying to create a simple mock of messaging Messaging.sendEmail
and in my code I'm trying to do the following to construct mocked instances of Messaging.SendEmailResult
Messaging.SendEmailResult result = new Messaging.SendEmailResult();
Compiler is giving the following error:
Type cannot be constructed: Messaging.SendEmailResult
Is there a work around?
Edit:
This doesn't work either:
Type t = Type.forName('Messaging', 'SendEmailResult');
Messaging.SendEmailResult newObj = (Messaging.SendEmailResult)t.newInstance();
Bummer...