5

Nor average, neither sum of percents. If some test methods cover one line of code twice, it only means that this exact line of code is covered. So the actual test coverage is linesCovered / allLines * 100. Example: imagine 1st test class covers one method in your controller (30%), 2nd test class covers 2 methods including the previous mentioned one (50%), ...


3

You have to query back the opportunity in order to see the value of the field. Since the value you are showing on the debug shows the value contained in the variable testOpportunity and not the value of the opportunity stored in memory(which was modified by the trigger). add a line after the update to update the value of the variable with the value stored ...


3

Your class is not covered because it contains no executable lines of code. There is nothing to cover. It is not necessary to add a constructor for the purpose of simulating coverage. Code coverage is defined as a percentage is executable lives covered, so your wrapper class requires no test class and does not impact your org's coverage.


1

Through manual testing, I believe the ApexTestResultLimits.LimitContext field is not displaying what you would logically assume it is. It doesn't appear to be related to what the documentation claims. Or it simply isn't working at all. I did a baseline SOQL query to measure the current state of the records: Select Id, ApexTestResultId, CreatedDate, ...


1

Did you write test code for this class? You need to create a test class that calls the method in your class, and a separate class that implements the HttpCalloutMock interface, which your test class invokes. In this class you mock a response to your callout. Relevant documentation: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/...


1

The first things to look for when a trigger is not receiving coverage are Is the test passing? Is the trigger being invoked by performing the correct DML operation? Is the trigger active? Per your comment, this time the issue was that the trigger was inactive.


1

ld.Id is null because you aren't really inserting it. List<Lead> Leadld = New List<Lead>(); lead ld = new lead(); ld.RecordTypeId = '012p0000000Nn05AAC'; ld.Company = 'Google'; // ... snipped ... insert Leadld; The Lead object ld is not in the list Leadld, which is empty. Your insert therefore does nothing, and ld.Id ...


1

Your privClaimID variable will be null because the expression assigned to it returns null so the ClaimData = ... query returns no rows, hence the error. This Building a Controller Extension documentation may help you with the design of your controller. And in tests, objects such as your testClaim have to be inserted into the database to have an Id value ...


1

Your SOQL query does not return any rows while you are trying to assign it to actual sObject. You should set testClaim.Id in yout test class to Page parameters, so in your controller you can get privClaimID from page params. I also strongly recommend you to post your questions with actual code and not screenshots, it makes answering your question a lot ...


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