It's difficult to test apex classes that use the built-in Messaging class to send emails; for starters, if the sandbox environment has deliverability turned off, each send will result in a failure.
https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_messaging.htm#apex_System_Messaging_sendEmail
It would be nice if we could add support for this method in the framework. We'd likely have to create its own class for this, so that DML and Emails could be mocked or use real data independently.
It's difficult to test apex classes that use the built-in
Messagingclass to send emails; for starters, if the sandbox environment has deliverability turned off, each send will result in a failure.https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_messaging.htm#apex_System_Messaging_sendEmail
It would be nice if we could add support for this method in the framework. We'd likely have to create its own class for this, so that DML and Emails could be mocked or use real data independently.