Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Test_MemberRestSvc - Test Class for Apex REST Service (v24)
private class Test_MemberRestSvc {
static {
// setup test data
static testMethod void testDoGet() {
RestRequest req = new RestRequest();
RestResponse res = new RestResponse();
req.requestURI = '';
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