You need to sign in to do that
Don't have an account?
srikanth kambampati 6
Hi all, i wrote one program to display the current dollar rate
This is my program,
public class Currency_Layer {
public String result {set;get;}
public void getCurrency() {
Http p =new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('callout:Currency_Layer');
request.setMethod('GET');
HttpResponse response = p.send(request);
result = response.getBody();
}
}
and My VF page is
<apex:page controller="Currency_Layer">
<apex:form >
<apex:commandButton value="Currency" action="{!getCurrency}"/>
{!result}
</apex:form>
</apex:page>
then , how write the test class for above code. please help me,
public class Currency_Layer {
public String result {set;get;}
public void getCurrency() {
Http p =new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('callout:Currency_Layer');
request.setMethod('GET');
HttpResponse response = p.send(request);
result = response.getBody();
}
}
and My VF page is
<apex:page controller="Currency_Layer">
<apex:form >
<apex:commandButton value="Currency" action="{!getCurrency}"/>
{!result}
</apex:form>
</apex:page>
then , how write the test class for above code. please help me,
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_wsdl2apex_testing.htm