You need to sign in to do that
Don't have an account?
Opportunity Trigger Class
Hello all,
Please review the code below, I don't get why its not passing 100%
Trigger:
Test:
I get not coverage on the highlight line "fi.add (new Itinerary__c("
Thankss!!
Ronaldo.
Please review the code below, I don't get why its not passing 100%
Trigger:
trigger CreateFlightItinerary on Opportunity (after update) { List<Itinerary__c> fi = new List<Itinerary__c>(); for (Opportunity a: Trigger.New) if (a.fi_automation_check__c == TRUE){ fi.add (new Itinerary__c( Flight_Booking__c = a.Id, Stop_1__c = a.Stop1_ID__c, Flight_Crew_1__c = a.CrewM_1_ID__c )); } insert fi; }
Test:
@isTest private class testCreateFlightItinerary{ static TestMethod void myTestClass() { Account a = new Account(); a.Name = 'TestName'; a.Phone = '5512991224391'; insert a; Opportunity o = new Opportunity(); o.Name = 'TestName'; o.AccountID = a.Id; o.closedate = system.today(); o.stagename = 'Sample Quote'; o.Aircraft_Type__c = 'King Air'; o.fi_automation_check__c=True; insert o; } }
I get not coverage on the highlight line "fi.add (new Itinerary__c("
Thankss!!
Ronaldo.
It still at 80%, same line uncovered. Any ideas?
Perhaps it is not creating the Itinerary record?
Thanks,
Ronaldo.
Let us know if this will help you
Thanks
Amit Chaudhary