I'm having some trouble setting up a testing class for a trigger that i wrote to populate a custom object with fields of a lead on lead conversion, in addition to the standard (Account, Contact, Opportunity) objects.
My test code is essentially creating a new lead, assigning it some default values and converting it through the Database.ConvertLead() method. I keep trying to tweak it, but my code coverage for my lead after update trigger is still 0%. Any thoughts would be greatly appreciated.
@isTest
public class TestCreateApp {
static testMethod void insertNewLead() {
Lead newLead = new Lead();
newLead.LastName = 'Lee';
newLead.FirstName = 'James';
newLead.Lead_Status__c = 'Open';
insert newLead;
Database.LeadConvert lc = new Database.LeadConvert();
lc.setLeadId(newLead.id);
test.startTest();
LeadStatus convertStatus = [Select Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
lc.setConvertedStatus(convertStatus.MasterLabel);
Database.LeadConvertResult lcr = Database.convertLead(lc);
System.assert(lcr.isSuccess());
test.stopTest();
}
}