-1
我需要爲以下觸發器編寫測試類,以便我可以增加測試共享,以便在salesforce上上傳包。我不知道如何編寫觸發器的測試類。需要爲銷售隊伍觸發測試共享類
Trigger AutoActivityCreation on Account(after update)
{
List<Task> task = new List<Task>();
for (Integer i = 0; i < Trigger.new.size(); i++) {
List<String> techs = Trigger.new[i].Toolsberry_new_tech_installs__c.split(';');
Integer added_tech = techs.size();
if(Trigger.new[i].Toolsberry_new_tech_installs__c=='null'){
added_tech=0;
}
List<String> re_techs = Trigger.new[i].Toolsberry_removed_tech_installs__c.split(';');
Integer removed_tech = re_techs.size();
if(Trigger.new[i].Toolsberry_removed_tech_installs__c=='null'){
removed_tech=0;
}
task.add(new Task(
whatid=Trigger.new[i].Id,
OwnerId=Trigger.new[i].OwnerId,
Subject='Technologies Added '+added_tech+' , Removed '+removed_tech,
Status = 'Completed',
ActivityDate = system.today()
)) ;
}
insert task;
}
can anybody help for this how to write test covrage class.
Thanks
Rajendra J.