We have a sample scheduler class and Test class. Please try like the below,
Scheduler Class:
global class ScheduleTerritoryInactiveMemberCheck implements Schedulable { global void execute(SchedulableContext SC) { TerritoryInactiveMemberCheck bcc = new TerritoryInactiveMemberCheck(); bcc.query = 'select id,name from territory'; Database.executeBatch(bcc,200); } }
Test class:
public static testMethod void testschedule() { Test.StartTest(); ScheduleTerritoryInactiveMemberCheck sh1 = new ScheduleTerritoryInactiveMemberCheck(); String sch = '0 0 23 * * ?'; system.schedule('Test Territory Check', sch, sh1); Test.stopTest(); }
We are the ISV Partners and Please reach us for custom development => www.merfantz.com
----------------------Hope this will help you!-------------------------