Created
August 20, 2024 19:34
-
-
Save brianmfear/3648e7ae9557f18d8385b4262c035bb0 to your computer and use it in GitHub Desktop.
q425223 support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@isTest class sendAnEmailSeleTest { | |
@isTest static void test() { | |
// Prepare your record data, possibly including parent/related records | |
Selement__c testSelement = new Selement__c( | |
// Populate fields here | |
Name = 'Test' // field = value, field = value, ... | |
); | |
insert testSelement; | |
// Build your request | |
sendAnEmailSele.Request[] requests = new sendAnEmailSele.Request[0]; | |
sendAnEmailSele.Request request = new sendAnEmailSele.Request(); | |
request.quoteId = testSelement.Id; | |
request.email = '[email protected]'; | |
requests.add(request); | |
Test.startTest(); | |
sendAnEmailSele.sendEmailWithAttachment(requests); | |
Test.stopTest(); | |
// Always verify the expected output with assertions | |
Attachment[] result = [SELECT ParentId FROM Attachment WHERE ParentId = :testSelement.Id]; | |
Assert.areEqual(1, result.size(), 'expected an attachment to be created'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment