• Rajat Koradiya 5
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I'm trying to write a test class on the code below. However i can only achieve 66% as i cannot insert the UserTeamMember object with a dml statement.  The 2 lines of code marked  as No Code Coverage are the only lines not covered and mainly because i can't insert the object. would appreciate any help . thanks !!!

trigger SSSUpdate on User (before Update)
{

Map<Id,Id> mapUserTeamIdVsuserId = new Map<Id,Id>();
for(UserTeamMember u :  [SELECT id,UserId,ownerid, User.Name FROM UserTeamMember where TeamMemberRole= 'Sales Support Specialist' AND OwnerId IN:Trigger.New]){
  mapUserTeamIdVsuserId.put(u.OwnerId,U.UserId);     (No  CODE COVERAGE)
}

for(User u1 : Trigger.New){
  if(mapUserTeamIdVsuserId.containsKey(u1.id)){
   u1.SSS__c= mapUserTeamIdVsuserId.get(u1.id);          (NO CODE COVERAGE)
  }
}
}