Timeline for Test class problem for a batch class
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 9, 2016 at 2:44 | comment | added | cropredy |
the above looks like it will invoke the execute() method twice
|
|
Dec 8, 2016 at 21:15 | comment | added | Keith C |
Invoking Database.executeBatch between a Test.startTest(); and Test.stopTest(); will run the start/execute/finish cycle for one batch so is a good way to go for most batchables.
|
|
Dec 8, 2016 at 21:05 | comment | added | dan | Yes I am using this approach very often. Please note that I have updated batch instance name from "batch" to "myBatchObject1" used in the question , now is clear I hope. | |
Dec 8, 2016 at 21:02 | history | edited | dan | CC BY-SA 3.0 |
from batch instance to myBatchObject1
|
Dec 8, 2016 at 21:01 | comment | added | Adrian Larson♦ | I believe that will cause an error. Have you tried it yourself? | |
Dec 8, 2016 at 20:57 | history | answered | dan | CC BY-SA 3.0 |