Questions about specific lines of code that need coverage or platform bugs. 75% of your Apex code must be covered by test classes. This tag is not intended for use when code coverage is simply lacking, but for scenarios where because of a particular configuration or system issue code coverage is ...

learn more… | top users | synonyms

5
votes
1answer
43 views

Test Coverage fail on simple before insert & update apex trigger

Apex n00b here. This has been gnawing me up over past few weeks. I have this very simple before insert / update trigger on Opportunity that auto-selects the Price Book based on a dropdown value ...
1
vote
0answers
46 views

code coverage for batch class

How can i get increase coverage for this code? I get only 55% so far. Also, when I am doing an assert, it should not be equal to '0' but for some reason if i do that then it complains saying it ...
6
votes
3answers
140 views

What classes and triggers have 0% code coverage?

I know that Salesforce is trying to push the developer console. Hence they removed the ability to see the code coverage in the classes view. The problem is that when I open the developer console and ...
8
votes
2answers
193 views

Pulling Production Code above 75%

I am having an issue, I have been with a company now and the person who came in before has deployed a bunch of stuff with no tests and shot the code coverage into the ground. I need to remove a bunch ...
-3
votes
1answer
59 views

I want to write a test to get code coverage for displaying a set of records in a table in a Visualforce page [closed]

I have an apex code as below: <apex:page controller="mySecondController" tabStyle="Account"> <apex:pageBlock title="Hello {!$User.FirstName}!"> You belong to the {!account.name} ...
3
votes
1answer
142 views

Stumped! Sandbox code coverage 89%, no org data in test class, yet deploy error - average code coverage is 0%

I created a rather simple Apex class VF11_controller in sandbox, which I'm looking to deploy to production. This apex class has one dependency, a VF page, which I added too in the change dataset. ...
1
vote
0answers
37 views

How to write test class for Default Account Team Members?

I am writing a test class which needs to cover code related to default account Team members. UserAccountTeamMember doesnt allow DML operation. Can you please let me know how to solve this issue in ...
3
votes
2answers
422 views

Can't see Apex Class Code coverage in packaging org using code coverage link

How can I check the cumulative line by line code coverage of an Apex class that is included in a managed package? I have a dev org where I create a managed package. It has already gone through a ...
1
vote
0answers
117 views

See the code coverage of my package without uploading it

I have a packaging org of a managed package and only 60% of its classes are actually part of my managed package. How or where can I check the code coverage of only those packaged classes without ...
2
votes
1answer
178 views

Unable to deploy code due to code coverage < 75%

I have in my prodn org test coverage of over 82%. I ran the Test-> runall test from developer console. I want to move in a few fields and 2 classes and 1 test class into prodn. These 2 classes have ...
2
votes
2answers
232 views

Apex class won't save for lack of test coverage

I have been using Force.com IDE to work on VisualForce pages and classes directly in a live development environment. I was unaware of the requirement that 75% of your code had to be covered by tests. ...
6
votes
1answer
711 views

Apex class Code Coverage stuck at 0% (No coverage data) after running test class

I have two classes: ClassA.cls - was generated from a WSDL some time ago. Currently on API v22.0 and hasn't been changed recently. Test_ClassA.cls - calls a large number of constructors in ClassA to ...
2
votes
1answer
97 views

How filter Apex Class View on code coverage?

In the Apex Classes page, how can I create a view that filters on code coverage ? Code coverage is one of the fields selectable so I figured I could do just do: Code coverage - less then - 90 But ...
1
vote
1answer
64 views

Code Coverage - Blue versus Red

I have various ranges of code that never show as "covered" in Apex Tests. Here are two examples. Could someone give me some guidance on them? How would I cover them? One: ((Just the ...