You need to sign in to do that
Don't have an account?
SFDC Guest
How to cover the map value in apex test class ?
Hi All,
Please let me know how to cover the Map in test class.
Map<Id,Id> mapIdString = new Map<Id,Id>();
for(sObject sObj: ObjList){
Id sLastMod = (Id)sObj.get(Label.LastModifiedById);
mapIdString.put(sObj.Id,sLastMod);
}
Thanks.
Please let me know how to cover the Map in test class.
Map<Id,Id> mapIdString = new Map<Id,Id>();
for(sObject sObj: ObjList){
Id sLastMod = (Id)sObj.get(Label.LastModifiedById);
mapIdString.put(sObj.Id,sLastMod);
}
Thanks.
"Try this code."
If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi
How to Cover Map in Test Class in Salesforce: Best Practices and Tips (https://traveltip-usa.com/how-to-cover-map-in-test-class/)
Please review the blog and if you find your solution there,then, please like this comment.