You need to sign in to do that
Don't have an account?
Baz Denson
Send data to a constructor from test class
I have the bare bones of a test class
Which works, but I am having trouble with sending data to the constructor. This is my constructor
How do I pass data to the constructor?
Thanks
Barry
@isTest public class sendEmailInvocableTest { static testMethod void testUseCase1() { List<sendEmailInvocable.emailParam> Params = new List<sendEmailInvocable.emailParam>(); sendEmailInvocable.SendEmail(Params); }
Which works, but I am having trouble with sending data to the constructor. This is my constructor
public class emailParam{ @InvocableVariable(required=true) public String sendTo; @InvocableVariable public String ccTo; @InvocableVariable public String salutation; @InvocableVariable(required=true) public String replyTo; @InvocableVariable(required=true) public String senderDisplayName; @InvocableVariable(required=true) public String subject; @InvocableVariable(required=true) public String plainBody; @InvocableVariable(required=true) public String HTMLBody; @InvocableVariable public String customVar1; @InvocableVariable public String customVar2; @InvocableVariable public String customVar3; @InvocableVariable public String customVar4; @InvocableVariable public String customVar5; }
How do I pass data to the constructor?
Thanks
Barry
Which works and gives 100% code coverage. I realise I need to do some asserts etc, but as far as the code goes, have I done it right and is there a better way to do it?