Skip to content

Instantly share code, notes, and snippets.

@jeffdonthemic
Created March 21, 2012 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffdonthemic/2146160 to your computer and use it in GitHub Desktop.
Save jeffdonthemic/2146160 to your computer and use it in GitHub Desktop.
Test_MemberRestSvc - Test Class for Apex REST Service (v24)
@isTest
private class Test_MemberRestSvc {
static {
// setup test data
}
static testMethod void testDoGet() {
RestRequest req = new RestRequest();
RestResponse res = new RestResponse();
req.requestURI = 'https://cs9.salesforce.com/services/apexrest/v.9/member/me/results/today';
req.httpMethod = 'GET';
RestContext.request = req;
RestContext.response = res;
MemberRestSvc.ReturnClass results = MemberRestSvc.doGet();
System.assertEquals('true', results.success);
System.assertEquals(10, results.records.size());
System.assertEquals('Query executed successfully.', results.message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment