You need to sign in to do that
Don't have an account?
aress
need test class for following
can anyone provide test cases for following scenario..consider all positive negative test cases.\
public class LeadRecord {
/**
This method displays total number of distinct Lead records on basis of 'Lead Source'
having greater than 10 leads.
@return Nothing.
*/
public static void displayLeads() {
List<AggregateResult> leadList = [
SELECT
LeadSource ls,
count_distinct(id) cnt
FROM
Lead
GROUP BY
LeadSource
HAVING
count_distinct(id) > 10
];
for(AggregateResult leadRecord : leadList) {
System.debug(leadRecord.get('ls') + ' -- ' + leadRecord.get('cnt'));
}
}
}
public class LeadRecord {
/**
This method displays total number of distinct Lead records on basis of 'Lead Source'
having greater than 10 leads.
@return Nothing.
*/
public static void displayLeads() {
List<AggregateResult> leadList = [
SELECT
LeadSource ls,
count_distinct(id) cnt
FROM
Lead
GROUP BY
LeadSource
HAVING
count_distinct(id) > 10
];
for(AggregateResult leadRecord : leadList) {
System.debug(leadRecord.get('ls') + ' -- ' + leadRecord.get('cnt'));
}
}
}
Hope it will help you
Thanks
Akshay