In the User's Guide there is a sample http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_test.htm?CSHID=apex_methods_system_test.htm#TestLoadDataExampleSection
of how to use the Test.loadData method to load a csv file with Accounts.
I cannot see any documentation nor samples showing how to load records with references (lookup or master-detail) to parent records - e.g. if I want to load Contacts, which refer to Accounts.
Anyone who knows. I suppose I am not going to "invent" record IDs????
I have created a CSV file and using Test.Load data I am able to get the corresponding record of the object.But my question is When I will require to insert a record of a object which is related to the earlier inserted object, how will I use Test.load data...Exmp
I have inserted Account object related data using Test.Load data.But in the same test method I need to insert Contact object related record.How will I do it?
I have tried in the following way....
List<sObject> ls = Test.loadData(Account.sObjectType, 'testAccounts');
Account a1 = (Account)ls;
List<sObject> con = Test.loadData(Contact.sObjectType, 'TestContacts');
Any way around??????????????