You need to sign in to do that
Don't have an account?

how to cover this line in test class
idstring= apexpages.currentpage().getparameters().get('recordid');
requestStatus =apexpages.currentpage().getparameters().get('request');
}
Public pagereference ChangeAccount(){
try{
List<string> recordIdList= idstring.split(',');
info=[select id,accountid__c,contactid__c,status__c,rejected__c from CompanyRequestInfo__c where id in: recordIdList];
Hi ezhil_k,
To these line from test class you the thing you need to do is to create some records of CompanyRequestInfo__c object within your test class in then use those records id to put in current page parameter recordid in comma separated way. Use following code to in your test class to cover above lines.
@isTest
List<CompanyRequestInfo__c > compReqList = new List<CompanyRequestInfo__c >() ;
compReqList.add(new CompanyRequestInfo__c (name ='Test1')) ; // Also fill required field information otherwise this record fail to insert in database.
compReqList.add(new CompanyRequestInfo__c (name ='Test2')) ; // Also fill required field information otherwise this record fail to insert in database.
insert compReqList ;
Apexpages.currentpage().getparameters().put('recordid',compReqList[0].Id+','+compReqList[1].Id) ;
Modify above code according to your need.
Now try to execute that method which have these line.
If this post helps you then hit kudus by clicking on star and accept my post as a solution to your question.