I need help creating a test class for the following apex class in order to get code coverage. Any thoughts or examples that could help me figure this out would be greatly appreciated. A previous developer created a bunch of classes and deployed them to production without unit testing any of them and now our Salesforce org is feeling this effect because we have dropped below the standard 75% code coverage limit. I'm cleaning up this by writing test classes to perform unit testing on these classes.
public class interviewEvaluationExtension {
private final Admissions_Interview_Evaluation__c eval;
// The extension constructor initializes the private member
// variable acct by using the getRecord method from the standard
// controller.
public interviewEvaluationExtension(ApexPages.StandardController stdController) {
this.eval = (Admissions_Interview_Evaluation__c)stdController.getRecord();
//could be improved by not hard coding field ID
List<Opportunity> opp = [select Id, AccountID, EMPLID__c, ACAD_PLAN__c, PLAN_DESCR__c, ADMIT_TERM_DESCR__c
from Opportunity
where id = :ApexPages.currentPage().getParameters().get('CF00N80000005VcoB_lkid')];
if(opp.size() > 0){
eval.Interviewee_Application__r = opp[0];
}
List<Account> acc = [SELECT Id, FirstName, LastName
FROM Account
WHERE Id = :eval.Interviewee_Application__r.AccountID];
if(acc.size() > 0){
eval.Interviewee_Application__r.Account = acc[0];
}
eval.Name = eval.Interviewee_Application__r.EMPLID__c
+ ' - '
+ eval.Interviewee_Application__r.Account.FirstName
+ ' '
+ eval.Interviewee_Application__r.Account.LastName;
}
}