+ Start a Discussion
devloper sfdcdevloper sfdc 

issue in test class of trigger

Hi All ,
I am facing issue to write test class of below trigger please help .

trigger UpdateRelatedUser on InContactData__c (before insert, after update ,before update) {
    set<Id> userid=new set<Id>();
     for(user u:[select id from user where Map_With_Incontact__c=true])
     {
         userid.add(u.id);
     }
      User Ult=[select id,InContact_AgentID__c from user where id in:userid];
     for(IncontactData__c ic:trigger.new)
     {
         if(trigger.isInsert || Trigger.isBefore)
         {
             
         if(ic.Agent_ID__c==ult.InContact_AgentID__c)
         {
           ic.Related_User__c=ult.id;  
         }
     }
     }
     
}
niven sfniven sf
Hello,

what is the issue you have facing
devloper sfdcdevloper sfdc
Code coverage 0%  my test class is 

@isTest
public class UpdateRelatedUserTest {
    
    static testMethod void Testuser() {
        
      List<InContactData__c> lst=new list<InContactData__c>();
      user u =[select id from user limit 1];
      InContactData__c ic=new InContactData__c();
        ic.Related_User__c=u.id;
     
        insert ic;
    
   
}
}