You need to sign in to do that
Don't have an account?
Saikiran Kolli
Test Class Problem for Pagereference
Hi,
My test class is not working please help me.
My test class is not working please help me.
public class google { public google(google1 controller) { } public google(ApexPages.StandardController controller) { } public pagereference google() { return new pagereference('/apex/PlotGoogleMarker'); } } @isTest public class googletest { @isTest static void test1() { PageReference ref = new PageReference('/apex/PlotGoogleMarker'); Test.setCurrentPage(ref); ref = new PageReference('/apex/PlotGoogleMarker?id='); Test.setCurrentPage(ref); System.assertEquals('/apex/PlotGoogleMarker?id=recordId',Ref.getUrl()); } }
1) http://amitsalesforce.blogspot.com/search/label/Test%20Class
2) http://amitsalesforce.blogspot.com/2015/06/best-practice-for-test-classes-sample.html
Please try below test class
Let us know if this will help you
All Answers
1) http://amitsalesforce.blogspot.com/search/label/Test%20Class
2) http://amitsalesforce.blogspot.com/2015/06/best-practice-for-test-classes-sample.html
Please try below test class
Let us know if this will help you
Can you please help me test classes for the below two methods,
public integer getsizeofsr(){
return srsize;
}
public PageReference closeChangeDay() {
chnageDayFlg = false;
return null;
}
NOTE:- If that is StandardController then call like below
Really appreciating your help,
I tried like this
static void test6() {
logView3Controller testaccount = new logView3Controller();
testAccount.Name='Test Account' ;
insert testAccount;
ApexPages.StandardController sc = new ApexPages.StandardController(logView3Controller);
closechangeday obj = new closechangeday(sc);
obj.closechangeday();
}
Error is Invalid type: closechangeday
Can u plz help me.