@isTest
private class caseUtil {
static testmethod void testLoadData() {
List < sObject > ls = Test.loadData(Case.sObjectType, 'testCases');
Case c = (Case) ls[0];
System.assert(ls.size() == 1);
String cStatus = c.Status;
DateTime cDate = c.CreatedDate;
System.debug('Case Id: ' + c.Id);
System.debug('Case Status: ' + cStatus);
System.debug('Case Date: ' + cDate);
c.status = 'New';
update c;
System.debug('Case status: ' + c.status);
}
}
@isTest
private class CaseTest {
static testmethod void testLoadData() {
String caseJSON = '{"attributes":{"type":"CasSe","url":"/services/data/v25.0/sobjects/Case/500E0000002nH2fIAE"},"Id":"500E0000002nH2fIAE","Status":"Open","CreatedDate":"2012-10-04T17:54:26.000+0000"}';
Case c = (Case) JSON.deserialize(caseJSON, Case.class);
System.debug('Test case:' + c.createdDate);
System.debug('Test caseId:' + c.Id);
System.debug('Test caseStatus:' + c.status);
Case c1 = new Case();
c1.Id = c.Id;
c1.status = 'New';
update c1;
System.debug('Test caseStatus1:' + c1.status);
}
}
000386257

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.