3

By default your test class can't read the records of your org. So in your method, if(testTranscripts1.size()>0) returns false and nothing happens. To allow it to see the record, you have to annotate your method with @isTest(SeeAllData=true). However, using SeeAllData is not a good idea since if anyone deletes the record named 00000089 in the org, your ...


1

The only way to properly cover the catch block is to somehow insert bad data and then try to update the record. Since you use a query to effectively verify the ID is valid and the user has read access to the record, your only real alternative is to create a fake user that has a limited DML operation (not System Administrator), so that the update will fail. ...


1

Disable retrieve-test-code-coverage from settings and try this vscode extension. You can get code coverage as in Developer Console in less time. https://marketplace.visualstudio.com/items?itemName=RaffaelePreziosi.apexgetcoverage


1

In my case, I was trying to get Assignment Rules from readMetadata and here's how I mocked it: private class WebServiceMockImpl implements WebServiceMock { public void doInvoke( Object stub, Object request, Map<String, Object> response, String endpoint, String soapAction, String requestName, String responseNS, String ...


Only top voted, non community-wiki answers of a minimum length are eligible