+ Start a Discussion
kiran k 12kiran k 12 

how to call the list as a parameter in method in test class?

i have created two classes.one is main class and sub class

sub class:
global class Rfleet_AdvensysResponseSchema_CLS {
global class VIN {
    
        webservice string vin;
        webservice string flockcom;
        webservice string immat;
        webservice string order;
        webservice string keycode1;
        webservice string energie;
        webservice string co2;
        webservice string carradiocode;
   }
}

Main class:
public static Date getMUTypeMaxDate(list<Rfleet_AdvensysResponseSchema_CLS.VIN> VinObject) {
     
    
       List<String> lstVinMax = new  List<String>();
       
       for(Rfleet_AdvensysResponseSchema_CLS.VIN MuMaxDate:VinObject){
          
          system.debug('### inside vins'+MuMaxDate.vin);
          lstVinMax.add(MuMaxDate.vin);
       } 
}

test class:I am calling the method with parameters but how to initiate the data into this list in test class
List<Rfleet_AdvensysResponseSchema_CLS.VIN> lstVin=new List<Rfleet_AdvensysResponseSchema_CLS.VIN>();
    Rfleet_AdvensysMappingDetails_CLS.getMUTypeMaxDate(lstVin);

but i got error.how to resolve this.please anybody help me
James LoghryJames Loghry
Hi Kiran, that looks correct to me.  What's the exact error you're receiving?  Could you post the entire class using the code format button or "< >"?