You need to sign in to do that
Don't have an account?
Guru 91
Help me test class with extended class?
Hi,
Can you please help me with test class
Class:
global class CDPWeeklyDigestBatchScheduler implements Schedulable {
global void execute(SchedulableContext sc) {
String query = 'SELECT Id, Deal_Id__c, Deal_Name__c, Deal_Stage__c, Type__c, Region_Type__c, Market__c, Deal_Owner__c, Latest_Change__c, Deal_Lost_Reason__c, Number_Of_Updates__c FROM CDP_Notification__c WHERE LastModifiedDate = LAST_N_DAYS:7 ';
List<SObject> records = Database.query(query);
NotificationHelper.getNotificationHelperInstance().notifyUsersAboutWeeklyDigest(records);
}
Can you please help me with test class
Class:
global class CDPWeeklyDigestBatchScheduler implements Schedulable {
global void execute(SchedulableContext sc) {
String query = 'SELECT Id, Deal_Id__c, Deal_Name__c, Deal_Stage__c, Type__c, Region_Type__c, Market__c, Deal_Owner__c, Latest_Change__c, Deal_Lost_Reason__c, Number_Of_Updates__c FROM CDP_Notification__c WHERE LastModifiedDate = LAST_N_DAYS:7 ';
List<SObject> records = Database.query(query);
NotificationHelper.getNotificationHelperInstance().notifyUsersAboutWeeklyDigest(records);
}
All Answers
Please follow this post, it will be very helpful for you to write test class for your schedulable class:
http://amitsalesforce.blogspot.com/2017/07/how-to-write-test-class-for-scheduler.html
Let me know if you face any issue.
Thanks
Niraj