You need to sign in to do that
Don't have an account?

At least 75% test coverage is required
I have been building an advanced Search visualforce application for weeks now using Force.com IDE in eclipse. The originally did it on the page but our SF account was upgraded to production and I was no longer able to access the APEX code on the page. So I have been deploying to server everytime I made a change and wanted to do testing on our SF instance. Just today I tried to deploy after some changes and got the error message,
" Average test coverage across all Apex Classes and Triggers is 0%, at least 75% test coverage is required".
This has never appeared before and I am stumped as to why it just appeared suddenly and it not allowing me to deploy my code anymore. Did something change recently? I have never written any tests for this and I am not sure even how to write tests in Apex.
Were you developing your Apex code in a trial org that was recently activated? When a trial org gets activated, the Apex code in that environment gets disabled and you must "deploy" the code to re-activate it or add new apex code to that environment. You won't be able to develop code in a production instance. Instead, you need to develop your Apex code in a Sandbox and "deploy" the code to Production. And this requires writing test methods that cover at least 75% of the apex code. Once you have the proper test methods in your Sandbox environment, you can use the Force.com IDE to deploy the code to your Production instance.
More information about test methods here.
It is a must to prove atleast 75% of your code is working as expected to be able to deploy to production.
am not a Salesforce Apex developer but I have managed to implement the apex pages and classes for Advanced opportunity search on our SandBox environment and it is working fine but when I try to upload to the live environment using Change Set of Salesforce, then it is not going through and producing following message.
“Average test coverage across all Apex Classes and Triggers is 65%, at least 75% test coverage is required.”
I have done some research on Salesforce community forum about this but could not fix this. Can you please help us to upload this to the live environment with maximum test coverage? I do not know how to write the tests for the apex classes. Could you please help me write this for the following classes.
I got the coding from Jeff Douglas website blog and then customised according to my environment.
http://blog.jeffdouglas.com/2010/07/13/building-a-dynamic-search-page-in-visualforce/
here is my apex class
and my apex page