You need to sign in to do that
Don't have an account?
newbiewithapex
How do I write test class method to cover If loop from EventHandler class?
I have the test class that is covering most of the EventHandler class but just missing this if loop coverage. Unfortunatly both classes are too big to post here. Can someone help me with this please?
if (Limits.getQueries() < Limits.getLimitQueries() && !eventOwnerIdSet.isEmpty()) { if (userMap == null) { userMap = new Map<Id, User> ([select Id, Sales_Coordinator__c, ProfileId from User]); } for (Event e: scEventList) { if (string.isNOTblank(userMap.get(e.ownerId).Sales_Coordinator__c)) { // current event owner must have an SC if (e.IsRecurrence ) { // if recurring event series e.ownerId = userMap.get(e.ownerId).Sales_Coordinator__c; System.debug('EventId1' +e.Id); processedRecEventIds.add(e.Id); // add series parent id to avoid processing the child records } else if (e.RecurrenceActivityId != null && !e.IsRecurrence) { // if recurring event child System.debug('EventId' +e.Id); Event parentEvt = [Select id, ownerId, whoId, isRecurrence from Event where id= :e.RecurrenceActivityId and isRecurrence=true]; //parentEvt.ownerId = userMap.get(parentEvt.ownerId).Sales_Coordinator__c; //update parentEvt; system.debug('####New Owner - '+parentEvt.ownerId); processedRecEventIds.add(parentEvt.id); } } else if ((e.IsRecurrence || !processedRecEventIds.contains(e.RecurrenceActivityId) || String.isBlank(e.RecurrenceActivityId)) && userMap.get(memberIdSCIdMap.get(e.Bulk_Item_Indicator__c)).ProfileId != SalesforceIds__c.getOrgDefaults().Profile_USF_SalesCoordinator__c){ } } }
Raj Vakati
Give me complete class
newbiewithapex