You need to sign in to do that
Don't have an account?

Hi,How to pass -ve values in test class,"getParentId()" this is another method with parameter and this method is assigned to "parent variable" and check with -ve values
,here is my code :Integer parent= getParentId(s.Forum_Year__r.Year__c ,auth.getAccessToken(),auth);
if (!(parent>0))
throw new WordpressException('Parent does not exist');
obj.parent=parent ;
if (!String.isEmpty(s.Session_Type__c)) {
Integer etype= lookupEvent(s.Session_Type__c,auth.getAccessToken(), auth);
List<Integer> evlst=new List<Integer>();
evlst.add(etype);
obj.event_type=evlst;
}
if (!(parent>0))
throw new WordpressException('Parent does not exist');
obj.parent=parent ;
if (!String.isEmpty(s.Session_Type__c)) {
Integer etype= lookupEvent(s.Session_Type__c,auth.getAccessToken(), auth);
List<Integer> evlst=new List<Integer>();
evlst.add(etype);
obj.event_type=evlst;
}
Hi satya,
If this is integration try to build the body for JSON format in test am implement the method WebServiceMock
see this link :
https://developer.salesforce.com/blogs/developer-relations/2013/03/testing-apex-callouts-using-httpcalloutmock.html
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_wsdl2apex_testing.htm
Thank you
Hi satya h
are you getting the values for getParentId() ? if not pass some dummy values to this method by calling this method