You need to sign in to do that
Don't have an account?
Kunal Purohit 4
How to implement test class for the given controller
Hello Folks,
I am new to salesforce development. Attempting to write a test class for below code. Please suggest.
public class CountContactHandler { public static void ContactCheckBox(List<Contact> con) { Set<Id> setid = new Set<Id>(); for(Contact c : con) { setid.add(c.AccountId); } List<Account> acc1 = [SELECT Id, Name From Account WHERE Id In :setid]; for(Account a1 : acc1) { } } }
This apex class seems to be incomplete. But below test class covers 100% . If you share the trigger as well so it may cover both.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
Is this handler for any trigger?
Thanks,
This apex class seems to be incomplete. But below test class covers 100% . If you share the trigger as well so it may cover both.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,