+ Start a Discussion
cml9cml9 

Please help creating test class..

rigger BulkyEmpSched on Schedule_Creator__c (after insert) {

for (Schedule_Creator__c BSched: Trigger.new ) {
String EmpID = Bsched.Employee_ID__c;
Datetime EmpSched = BSched.Start_Date_and_Time__c;
if (BSched.Start_Date_and_Time__c != NULL) {

    for (integer counter=0; counter <=4; counter ++){
  Employee_Schedule__c nAtt = new Employee_Schedule__c();
  nAtt.Start_Time__c = EmpSched.addDays(counter);
    nAtt.Employee_ID__c= EmpID;
       
insert nAtt;
        
    }
}}}

=======================
Here is my Test Class but its not passing :(

@isTest
Public Class Bulk_Schedule_Creator {
    
    
   static testMethod void insertnewBulkySched () {
        
       Schedule_Creator__c scCreator = new Schedule_Creator__c();
        scCreator.Employee_ID__c    = 'GA-0001';
        scCreator.Start_Date_and_Time__c = Datetime.now();
       
       
        insert scCreator;
    
   Employee_Schedule__c EmpScheds = new Employee_Schedule__c ();
        EmpScheds.Start_TIme__c = Datetime.now();
        EmpScheds.Employee_ID__c = 'GA-0001';
        
        insert EmpScheds;
    }
}



Thank you