+ 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 
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';
        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