New answers tagged

1 vote

Test Code Coverage - Delete DML catch block

You can use the Test.isRunningTest method to check if the code is running in a test context and then throw a custom exception. For example, you can modify your main class code like this: @AuraEnabled ...
Tushar Jadav's user avatar
0 votes

Test class for batch with another class called in it: Batch has 100%, but called class only 24% coverage

Sorry for bothering you, it was a after Inset trigger that I was unaware of which was updating a field value, so problem was solved after updating field value after insert.
Pratik Bokade's user avatar

Top 50 recent answers are included