You need to sign in to do that
Don't have an account?
Graham Booth 11
How To Create Basic Code Coverage
Is there any way of creating a basic Code Coverage Class to allow me to move the changes to Production?
The visualforce page I have is simply to have an output in PDF format. There is no record update or inserts. Is there anyway of creating somewhich will allow me to push the code to Production
thanks
The visualforce page I have is simply to have an output in PDF format. There is no record update or inserts. Is there anyway of creating somewhich will allow me to push the code to Production
thanks
For example if you have a VF page with PDF format output, i assume you have a controller class or component for retrieving the data to be displayed on the PDF. (The VF page itself doesn't need coverage)
The basic code coverage for it then would be using test class that simulates the controller class being called and used for the VF page, and if that controller class needs information from other SObject record we'd have to create those as well in the test class so your controller class can simulate the process and thus cover them.
There is technically a way to cheat Salesforce 75% requirement for deploying into production in the test class, but this is something we don't want to do unless we for some reason need to deploy NOW, and damn all the consequence.
as previously stated, I am extremely new to this and and may have got a little confused. When I have tried to deploy again, I have checked the errors and the errors are:
The following triggers have 0% code coverage. Each trigger must have at least 1% code coverage.
DefaultName
Seems I found the way around test classes for the Visualforce page (This actually just uses Standard Controller and then uses the Related List command), but have the problem with the triggers.
The biggest issue is that I am new to writing code, have been an admin for many years, but decided to support a Charity and deploy Salesforce but trying to get this POC up and running before they open their doors.
Any suggestions on how to get this done?
thanks