Hi,
Here is an example that will explain how to write a unit tests for a wrapper class.
wrapper:
public class submitPsOSimpleServiceDetailWrapper{
public string providerId{get;set;}
public string patientId{get;set;}
public string productId{get;set;}
public PsOSimpleWrapper.PaitentInformationWrapper patientDetails{get;set;}
}
public class PsOSimpleWrapper{
public class PaitentInformationWrapper{
public string PatientfirstName {get;set;}
public string PatientMI {get;set;}
public string PatientlastName {get;set;}
}
}
test class code:
public static testmethod void Test_1(){
string psosimplejson='{“providerId”:””,”patientId”:””,”productId”:””,”patientDetails”:[patientDetails: {“PatientfirstName”:””,”PatientMI”:””,”PatientlastName”:””,”PatientdateOfBirth”:””}]}’;
string str= PsOSimpleServiceController.savePaitentInformation(psosimplejson);
//have covered all the wrappers in test class
}