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

Need help in test class for StandardController
Hi All,
I am new to salesforce.
I have created a custom button in visualforce page to change status field.
I have written visualforce page and controller class for the same.
I want to write test class for the same class.
Here is my code
Please help me
Thanks in Advance
I am new to salesforce.
I have created a custom button in visualforce page to change status field.
I have written visualforce page and controller class for the same.
I want to write test class for the same class.
Here is my code
public with sharing class changeStstus { Public id lid; Public Order lRec; Public string strRs{get;set;} public string strSt{get;set;} public changeStstus(ApexPages.StandardController controller) { if(ApexPages.currentPage().getParameters().get('id') != null) { lid= ApexPages.currentPage().getParameters().get('id'); getRecord(lid); } } public void getRecord(ID lid){ lRec = [select id,F1__c,status from Order where id =:lid]; strRs = lRec.F1__c; strSt='Saved'; } public PageReference Save(){ lRec.F1__c = strRs; lRec.status= strSt; lRec lRec; PageReference ReturnPage = new PageReference('/' + lRec.id); ReturnPage.setRedirect(true); return ReturnPage; } public PageReference Cancel(){ PageReference ReturnPage = new PageReference('/' + lRec.id); ReturnPage.setRedirect(true); return ReturnPage; } }
Please help me
Thanks in Advance
thanks
All Answers
This is my VF page.
I tried test as below
but I am able to cover only two lines.
Can you please help me in this?
Thank you
thanks