You need to sign in to do that
Don't have an account?
SANDEEP CHITTINENI
How can i write a test class for apex class-----Can I grab some help??
public class FieldUpdate {
public List<Vehicle__c> v;
public String st;
public void FieldUpdate(){
v=[select id,Date__c,Status__c from Vehicle__c where (Date__c=:date.today())];
for(Vehicle__c vh : v)
{
if(vh.Date__c==date.today())
{
st=vh.Status__c;
string lt=st.remove('-Future');
vh.Status__c=lt;
update vh;
}
}
}
}
Thank you,
Sandeep
public List<Vehicle__c> v;
public String st;
public void FieldUpdate(){
v=[select id,Date__c,Status__c from Vehicle__c where (Date__c=:date.today())];
for(Vehicle__c vh : v)
{
if(vh.Date__c==date.today())
{
st=vh.Status__c;
string lt=st.remove('-Future');
vh.Status__c=lt;
update vh;
}
}
}
}
Thank you,
Sandeep
try below test class it will give 100% code coverage I hop it helps you
Mark it best answer if it helps you so it make proper solution for others
Thanks
All Answers
try below test class it will give 100% code coverage I hop it helps you
Mark it best answer if it helps you so it make proper solution for others
Thanks
go to below link for best practice of writing test class
http://amitsalesforce.blogspot.in/2015/06/best-practice-for-test-classes-sample.html
Thanks :)