Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class contactUpdateFromScheduleClassTest {
@isTest static void contactUpdateTest_Schedule() {
Contact cont = new Contact(FirstName ='First Name', LastName ='Last Name', Email='');
insert cont;
// Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
String CRON_EXP = '0 6 * * * ?';
String jobId = System.schedule('Update Contacts', CRON_EXP, new scheduleStoneExRates());
CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger WHERE id = :jobId];
System.assertEquals(CRON_EXP, ct.CronExpression);
System.assertEquals(0, ct.TimesTriggered);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment