You need to sign in to do that
Don't have an account?
JoshTonks
Test Class For Scheduable Apex Batch
I have written a Batch Class which is called by a Scheduable class I have written. Im still trying to get my head round tests classes.
I have a test class for the Batch Class. But i dont know how to do write a test class where the schedulable class is calling a Batch Class. This is my Schedule class can someone explain to me what im actually testing for on this one because like I said i fully understand test classes.
I have a test class for the Batch Class. But i dont know how to do write a test class where the schedulable class is calling a Batch Class. This is my Schedule class can someone explain to me what im actually testing for on this one because like I said i fully understand test classes.
global class OrderBatchEditScheduler implements Schedulable{ global void execute(SchedulableContext sc) { OrderDailyBatchEdit b = new OrderDailyBatchEdit(); Database.executebatch(b,200); } }
I suggest that you do the following with Test.startTest and Test.stopTest. Usually there is no need to verify that the actual scheduling works, just that the execute method does what it should.
Regards,
MKR
All Answers
I suggest that you do the following with Test.startTest and Test.stopTest. Usually there is no need to verify that the actual scheduling works, just that the execute method does what it should.
Regards,
MKR