To test your custom form logic Booker25 contains a global class called Test_FormHelper. This class contains helper methods that allow you to trigger form events as if they are coming from the form.
Because these methods fire an event as if it was fired from the form to make the behaviour consistent during unit tests and normal operation the default booker25 handlers are also fired. This means the return value of FormEvent could include FormEvents produced by Booker25.
Methods
runFormInitializationEvent
Using this method you can trigger a form initialization event to test your custom form implementations.
List<B25.FormEvent> runFormInitializationEvent(B25.Test_FormHelper.TestFormContext formContext)
Return value: List<B25.FormEvent>
Parameters:
Name | Type | Description |
---|---|---|
formContext | The context of the form during the initialization event. |
runFieldChangeEvent
Using this method you can trigger a field change event to test your custom form implementations.
List<B25.FormEvent> runFieldChangeEvent(B25.Test_FormHelper.TestFormContext formContext, B25.Test_FormHelper.TestChangeEvent changeEvent)
Return value: List<B25.FormEvent>
Parameters:
Name | Type | Description |
---|---|---|
formContext | The context of the form during the field change event. | |
changeEvent | The change event that is being fired |
runRelatedListAddEvent
Using this method you can trigger a related list item add event to test your custom form implementations.
List<B25.FormEvent> runRelatedListAddEvent(B25.Test_FormHelper.TestFormContext formContext, B25.Test_FormHelper.TestRelatedListEvent changeEvent)
Return value: List<B25.FormEvent>
Parameters:
Name | Type | Description |
---|---|---|
formContext | The context of the form during the related list add event. | |
changeEvent | The related list event that is being fired |
runRelatedListRemoveEvent
Using this method you can trigger a related list item remove event to test your custom form implementations.
List<B25.FormEvent> runRelatedListRemoveEvent(B25.Test_FormHelper.TestFormContext formContext, B25.Test_FormHelper.TestRelatedListEvent changeEvent)
Return value: List<B25.FormEvent>
Parameters:
Name | Type | Description |
---|---|---|
formContext | The context of the form during the related list remove event. | |
changeEvent | The related list event that is being fired |
runLookupOverrideSearch
Using this method you can trigger a search event to test your custom form implementations.
B25.SearchResultCollection runLookupOverrideSearch(B25.Test_FormHelper.TestFormContext formContext, B25.Test_FormHelper.TestSearchContext testSearchContext)
Return value: B25.SearchResultCollection
Parameters:
Name | Type | Description |
---|---|---|
formContext | The context of the form during the related list remove event. | |
changeEvent | The search context. |