function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Apurv SaxenaApurv Saxena 

Apex Specialist Challange 4 : Unable to cover my methods

@isTest
public class MaintenanceRequesTest {
    @isTest
    static void testMaintenanceRequest(){
        
        List<case> caseList1 = new List<case>();
        List<case> caseList2 = new List<case>();
        
        for(Integer i=0;i<200;i++){
            Case c = new Case();
            c.Status = 'Closed';
            c.Type = 'Repair';
            c.Vehicle__c = c.Id;
            caseList1.add(c);
        }
        for(Integer j=0;j<200;j++){
            Case c = new Case();
            c.Status = 'Closed';
            c.Type = 'Routine Maintenance';
            c.Vehicle__c = c.Id;
            caseList2.add(c);
        }
        caseList1.addAll(caseList2);
        if(caseList1.size()>0){
        	insert caseList1;    
        }
        
    }
}
This is my test class for Maintenance Request but I am unable to increase my code coverage. Please help me in clearing this challenge.

Thanks in advance
 
SandhyaSandhya (Salesforce Developers) 
Hi,

Please refer below link where the code has been posted for test class and cross check with yours.

http://salesforce.stackexchange.com/questions/130242/superbadges-apex-specialist-the-maintenancerequest-trigger-does-not-appear
 
Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
 
Thanks and Regards
Sandhya