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
VINODKUMAR REDDY KALUVAVINODKUMAR REDDY KALUVA 

Test class code coverage problem inside for loop

I just want to know why I'm not able to get the code coverage inside for loop when I'm just adding value to string variable in the for loop 
Why I'm not able cover that red line in the code

Test class below:
@isTest

Public class TestOrderAcknowledgement{

   @isTest static void myTest() {
    String custmpo;
   Order__c orp=new Order__c();
        orp.Date_of_Order__c=Date.today();
        orp.Order_To_Street__c='Baasdfngavzdvladfore';
        orp.customer_po__c='ewfew';
   Insert orp;
       
   List<Ordger__c>   order1=[Select Name,Id,customer_po__c from Order__c where Id=:orp.Id];
       for(Order__c ord:order1){
        custmpo=ord.customer_po__c;    
       }
       
   Order_item__c orli=new Order_item__c();
   
   orli.Name='221N4fdzgHY78';
   orli.Description__c='this is description';
   orli.price__c=283;
   orli.order__c=orp.id;
   orli.quantity__c=52;
   
   Insert orli;
       
       OrderAcknowledgement controll = new OrderAcknowledgement(new ApexPages.StandardController(orli));
   }
    


}


 
Best Answer chosen by VINODKUMAR REDDY KALUVA
VINODKUMAR REDDY KALUVAVINODKUMAR REDDY KALUVA
I got the Answer.

When I Just pass the Id like this I got It covered 
Apexpages.currentPage().getparameters().put('id',orp.id);

Thanks