function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vikas rathi91vikas rathi91 

how to cover the test class

User-added image

how to cover these line I am try but not success to cover these line 
@isTest
public class  EmailMessageTriggerHandlerTest{

 public static testMethod void test(){
  Contact objCon = new Contact();
     objCon.FirstName = 'Manas';
     objCon.LastName = 'Manas';
     objCon.AccountId = objacc.id;
     objCon.Email = 'ab@gmail.com';
     objCon.Phone = '(987) 456-4567';
     objCon.Five9_Source__c = 'Outdoor_B2B';
     objCon.MailingState = 'sd';
     insert objCon;
     
     Task t = new Task();
        t.OwnerId = UserInfo.getUserId();
        t.whoId= objcon.id;
        t.Subject='[Outreach] [Email] [Out] Hello';
        t.Status='Not Started';
        t.Priority='Normal';
        insert t;  
     }
}

 
Amit Chaudhary 8Amit Chaudhary 8
Can you please post your full trigger code . And please check you have any space in your trigger code or test data.

in [Outreach] [Email] [Out] Hello string