
Hi ,The below test class might helpful to you. Just ensure, give all mandatory field values while inserting neo employee request record.
If this solution helps, please mark this as solution.@isTest
private class TestWizard_3a_ControllerNEO4
{
private List<NEO_Employee_request__c> nerList;
static testMethod void insertNEOEmployee()
{
nerList = new List<NEO_Employee_request__c>();
createNEO('Urgent', System.today() - 10);
createNEO('Regular', System.today() - 10);
createNEO('Regular', System.today() + 10);
insert nerList;
Wizard_3a_ControllerNEO4 wc = new Wizard_3a_ControllerNEO4();
wc.getacts();
wc.getacts2();
wc.getacts3();
wc.getacts4();
wc.getacts5();
wc.Urgent();
wc.Regular();
wc.Due_date();
}
private void createNEO(String urgency, Date d)
{
// Ensure give value for all mandatory fields.
NEO_Employee_request__c ner = new NEO_Employee_request__c();
ner.Name = 'Test NER';
ner.Urgency__c = urgency;
ner.Status__c = 'Approved';
ner.Due_date__c = d;
nerList.add(ner);
}
}
3 respuestas