Skip to content

Instantly share code, notes, and snippets.

@sakthivelsfdc
Last active March 2, 2020 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakthivelsfdc/9a1d24881747dd9482154cb007583ea5 to your computer and use it in GitHub Desktop.
Save sakthivelsfdc/9a1d24881747dd9482154cb007583ea5 to your computer and use it in GitHub Desktop.
contactUpdateFromScheduleClassTest.cls
@isTest
public class contactUpdateFromScheduleClassTest {
@isTest static void contactUpdateTest_Schedule() {
Contact cont = new Contact(FirstName ='First Name', LastName ='Last Name', Email='sakthi@theblogreaders.com');
insert cont;
// Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
String CRON_EXP = '0 6 * * * ?';
Test.startTest();
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);
Test.stopTest();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment