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
rohi rohirohi rohi 

custom object fields

Hi,

My test class is not covering custom object fileds,see the below code.

in test class i am calling  a method  by passing list of ids,
RequestHandler.createProces(listof ids);

in actual class i'm validating contact ids and if that contact id is not there in another object i'm inserting that id along with other values,code is below:

 List<Request__c> lsRequest;
       Request__c oRequest = new Request__c();     
        List<Request__c> lWr = new List<Request__c>();
for(....)
{
 lsRequest =[SELECT Active__c ,Member__c,attempt_1__C,attempt_2__C,attempt_3__C FROM  Request__c WHERE
                               member__c =: c.Id and Active__c=true and (Attempt_1 __c = true OR Attempt_1 __c = true OR Attempt_1 __c = true)];
           
            oRequest =  (!lsRequest.isEmpty() && lsWaiver_Request.size()>0) ?lsWaiver_Request[0] : null;
          
      //if empty i'm inserting values 
            if(lsRequest.isEmpty())
            {   
              
              //test class is not covering these fields
                oRequest.Member__c = c.id;             
                oRequest.Attempt_1__c = true;
              //few other fileds
}
 
Thanks

 
sandeep reddy 37sandeep reddy 37
what kind of precuation consoling and did you used dml statement and  use assert equal or not equal function