mercredi 22 juin 2016

Apex Test Error - Testing already started - after stopTest()

I have got a question about testing.

I tried to do something like this:

Test.startTest(); //#1
Test.stopTest();  //#2
Test.startTest(); //#3
Test.stopTest();  //#4

I expected, that #2 will stop the test before #3, but when I run this test, I see this error message:

System.FinalException: Testing already started
Line #3

If I would comment all #3 line, then I see this message:

System.FinalException: Testing already stopped
Line #4

It seems my test is in superposition of states?

Salesforce v37

Aucun commentaire:

Enregistrer un commentaire