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

soql test class
Can anyone help me in test class of following code.??
To retrieve record of contact object.
public with sharing class ContactRecords {
/**
Method : getContactRecord()
Description : To fetch Id,Name,Department from Contact Object
*/
public List<Contact> getContactRecord(){
List<Contact> contactList = [SELECT Id,Name,Department
FROM Contact];
System.debug(contactList);
return contactList;
}
}
//Cover as many test cases as possible.
Thanks
To retrieve record of contact object.
public with sharing class ContactRecords {
/**
Method : getContactRecord()
Description : To fetch Id,Name,Department from Contact Object
*/
public List<Contact> getContactRecord(){
List<Contact> contactList = [SELECT Id,Name,Department
FROM Contact];
System.debug(contactList);
return contactList;
}
}
//Cover as many test cases as possible.
Thanks
All Answers