You need to sign in to do that
Don't have an account?
Lauren B
How to write test class for page reference.
Hi alI,
I need to write test class for below apex class and I'm only getting 33% code coverage. I'm not able to cover the page reference in my test class.Please help.
I need to write test class for below apex class and I'm only getting 33% code coverage. I'm not able to cover the page reference in my test class.Please help.
public class TestControllerExtension{ public Test2__c cca {get;set;} public TestControlleExtension() { cca =new Test2__c (); cca= [select Test2_Request_ID__c,Test2_RecordType__c,Test2_Suffix__c,Test2_DOB__c,Test2_Middle_Name__c,Test2_Flag__c,Test2_Sex__c,Test2_SSN__c,Test2_First_Name__c, Test2_Last_Name__c, Test2_Family_ID__c, Test2ReportDate__c,Test2_BENE_SSN1__c, from Test2__c Where Id = :ApexPages.currentPage().getParameters().get('RequestID')]; } public Test2__c getcca() { return cca; } public PageReference NextPage(){ PageReference p = new PageReference('/apex/TestPageButtonNextPage?RequestID'); p.setRedirect(false); return p; } public PageReference PreviousPage(){ PageReference p1 = new PageReference('/apex/TestPageViewButton?RequestID'); p1.setRedirect(false); return p1; } }
You can take reference from this below code.
In case you find any other issue please mention.
If you find your Solution then mark this as the best answer.
Thanks and Regards
Suraj Tripathi.
All Answers
You can take reference from this below code.
In case you find any other issue please mention.
If you find your Solution then mark this as the best answer.
Thanks and Regards
Suraj Tripathi.
It workerd. I really appriciate your help. Thank you so much.