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
Abhishek Kumar 149Abhishek Kumar 149 

how to write test class for below code?

 isOutput = false;
        isInput =  false;
        
        parentId = ApexPages.currentPage().getParameters().get('pId');
        recordId = ApexPages.currentPage().getParameters().get('Id');
      
      
        }
        
       
        
ManojjenaManojjena
HI Abhishek,

You need to create a record in test method .
Like below ,
Account acc=new Account();
acc.Name='TestAccount'
insert acc;
 ApexPages.currentPage().getParameters().put('pId',acc.Id);
replace acc.Id with your desired record id .
Do the same for next line .
let me know if it helps !!
Thanks
Manoj