You need to sign in to do that
Don't have an account?
bonny mankotia
Need a Test Class For This Simple code
Here is the Code.
public class actionFunctionController {
public Account acc{get;set;}
public Boolean showPhone{get;set;}
public actionFunctionController(){
acc = new Account();
showPhone = false;
}
public PageReference priorityChanged(){
if(acc.CustomerPriority__c == 'High'){
showPhone = true;
}
else
{
showPhone = false;
}
return null;
}
}
public class actionFunctionController {
public Account acc{get;set;}
public Boolean showPhone{get;set;}
public actionFunctionController(){
acc = new Account();
showPhone = false;
}
public PageReference priorityChanged(){
if(acc.CustomerPriority__c == 'High'){
showPhone = true;
}
else
{
showPhone = false;
}
return null;
}
}
Here is the documentation for How to write test class.
https://developer.salesforce.com/page/An_Introduction_to_Apex_Code_Test_Methods
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_example.htm
Mark this as a solution if it helps you. ENJOY APEX
-Thanks
Ashlekh Gera
All Answers
Here is the documentation for How to write test class.
https://developer.salesforce.com/page/An_Introduction_to_Apex_Code_Test_Methods
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_example.htm
Mark this as a solution if it helps you. ENJOY APEX
-Thanks
Ashlekh Gera
This is the test class for above class .
Thanks
Rupal Kumar
Mirketa Software Pvt Ltd
http://mirketa.com/index.html
This code covers 90% of the block(code coverage) so we need not cover If block statement as salesforce test clas requres only75% of code coverage for deployment.
Thanks
Rupal Kumar