You need to sign in to do that
Don't have an account?
andrewskelton
Test Coverage 0% across 2 classes - Help
I have 2 classes that I am trying to move into production. 1 class is my controller and the other is a purely Test class for testing of the controller. I am getting the error about Average Test coverage across all classes and triggers is 0%.......
The controller class has 0% when I run the Test in the Sandbox and the Test class has 100% coverage.
Can someone give my ideas or pointers about what I am missing.
Thanks for your help.
Try to write the test metod for the controller in the controller itslef instead of writing a seperate class.That more efficient.
It sounds like you test class isn't actually doing anything with the controller if the coverage is 0% - can you post your code?
Here is my controller and test code. My question is does the test class have to create an instance of the controller? Thanks for all your help.
Code:
Test Class:
The test method most definitely has to create an instance of the controller class. The testmethod has to 'simulate' what happens when VF performs an action (i.e. set up query string parms, instantiate/construct a controller class, instantiate public properties, and then execute the controller action.
This is all documented in the VF Developers Guide under Controller testing