I have a custom setting where I store Id's for my dock records. (Dock__c)
In my test class after "creating" the custom setting and my other records, how can I reference the custom setting to match my dock record? How can I set an ID of the dock record in my custom setting for the test class?
@isTest
static void testDocks(){
shipment__c shipment = DataStorage.insertShipment('Shipment1');
insert shipment;
shipment.0f_package__c =0;
update shipment;
Package__c p = DataStorage.makePackage('p1');
insert p1;
LocationSets__c ls = new LocationSets__c
LocationSets.Name ='ls test';
LocationSets.Dock1__c =(it is a text field to hold the ID of the
actual dock1__c);
insert ls;
Test.startTest();
p1.Status__c = 'Ready to Ship';
p1.Shipment__c = shipment.id;
p1.Dock__c = LocationSets.dock1__c;
update p1;
Test.stopTest();
shipment = [SELECT ID, Status__c FROM shipment__c WHERE ID = :shipment.id];
System.assertEquals('Ready', shipment.Status__c);
}