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
Praveen BonaluPraveen Bonalu 

Email services test class (Code Coverage Issue)

Hi every one,

I am not able to get the code coverage for the following test class.

Can anyone please help me  in code coverage.

I am not sure where i am doing wrong.

Please see below test class i have written for the Email services inbound handler.
public class ProcessJobApplicantEmail_Test {
    static testMethod  void TestApplicant()
         // Create a new email and envelope Object
        Messaging.InboundEmail email = new Messaging.InboundEmail();
        Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();
        //setup the data for the email 
        email.subject='Test Job Application';
        email.fromname='Mike Villo';
        //add an attachment 
        Messaging.InboundEmail.binaryAttachment attachment = new Messaging.InboundEmail.binaryAttachment();
        attachment.body=blob.valueOf('Test Job Application');
        attachment.mimeTypeSubType = 'text/plain';
        email.binaryAttachments = new Messaging.inboundEmail.BinaryAttachment[] { attachment };
        ProcessJobApplicantEmail emailProcess = new ProcessJobApplicantEmail();
        emailProcess.handleInboundEmail(email, env);
        Candidate__c can =[select id, First_Name__c, Last_Name__c, Email__c from Candidate__c
         where First_Name__c = 'Mike' and Last_Name__c = 'Villo' and Email__c='' and Province__c='Ontario'];
        Attachment a = [select name from attachment where parentId =];