Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Overview

Object that is used to specify the form context inside of unit tests.

To test your custom form API implementation you need to be able to specify the state of the form when the event handlers are fired. This class contains this state.

Example

B25.Test_FormHelper.TestFormContext formContext = new B25.Test_FormHelper.TestFormContext();
formContext.reservation = new B25__Reservation__c(
  B25__Start_Local__c = Datetime.now(),
  B25__End_Local__c = Datetime.now().addHours(1)
);
formContext.relatedSObjects.put('B25__ReservationContact__c', new List<SObject>{
  new B25__ReservationContact__c()
});

Properties

Name

Type

Description

reservation

B25__Reservation__c

The reservation on the form during the firing of the event.

relatedSObjects

Map<String, List<SObject>>

The related lists on the form during the firing of the events.

On this page

  • No labels