You need to sign in to do that
Don't have an account?
JoVill
How to create test method without DML
Hi All.
I need help from masters.
I created managed package with Apex classes VF pages .... Now I need to upload my package into Apexchange
but I can't because of what is required from 75 - 100% tests for Apex code.How to create test methods for Apex classes like this:
Public class AppProcListHelp please.This is very important and urgent. Thanx.
{
public PageReference ShowFullR() {
PageReference pageRef = new PageReference('/grape/grape.apexp?Id=04aA0000000TNJl');
pageRef.setRedirect(true);
return pageRef;}
public PageReference ShowShortR() {
PageReference pageRef = new PageReference('/grape/grape.apexp?Id=04a800000000Bvt');
pageRef.setRedirect(true);
return pageRef;}
public PageReference ShowFullP() {
PageReference pageRef = new PageReference('/grape/grape.apexp?Id=04aA0000000TNMg');
pageRef.setRedirect(true);
return pageRef;}
public PageReference ShowFullI() {
PageReference pageRef = new PageReference('/grape/grape.apexp?Id=04a800000000C6g');
pageRef.setRedirect(true);
return pageRef;}
public PageReference ShowFullRi() {
PageReference pageRef = new PageReference('/grape/grape.apexp?Id=04a800000000C6l');
pageRef.setRedirect(true);
return pageRef;}
public PageReference ShowFullRbv() {
PageReference pageRef = new PageReference('/grape/grape.apexp?Id=04aA0000000TNMl');
pageRef.setRedirect(true);
return pageRef;}
}
Anand@SAAS
Check out how to create testing custom controllers here. Testing methods don't have to do DML all the time.