You need to sign in to do that
Don't have an account?
rupesh ranjan
Any one can write TEST class for below code
I want to write test class for below code
code is for selected contact which is stored in wrapper class(wrapContact )
code is for selected contact which is stored in wrapper class(wrapContact )
Public class sendmailexample{ public List<wrapContact> wrapContactList {get; set;} public List<Contact> selectedContacts{get;set;} Public String selectId {get;set;} public sendmailexample(){ body = apexpages.currentpage().getparameters().get('att'); if(wrapContactList == null) { wrapContactList= new List<wrapContact>(); for(Contact a: [SELECT Name,FirstName,LastName,Email,Title FROM Contact ORDER by Name ASC]) { wrapContactList.add(new wrapContact(a)); } } body = ''; to = EmailCon; } public void processSelected() { AddRecep = ''; selectedContacts = new List<Contact>(); for(wrapContact wrapContactObj : wrapContactList) { if(wrapContactObj.selected == true) { selectedContacts.add(wrapContactObj.acc); if (AddRecep == '') { AddRecep = wrapContactObj.acc.Email; } else { AddRecep += ';' + wrapContactObj.acc.Email ; } } } } public class wrapContact { public Contact acc {get; set;} public Boolean selected {get; set;} public wrapContact (Contact a) { acc = a; selected = false; } } }
Please find the below Test Class:
Please do let me know if it helps you.
Regards,
Mahesh