Is it possible to configure a unit test for a control procedure instead_of_trigger?
I have a CP which inputs values when a user changes them in a view.
The CP does some calculation and then updates values of multiple rows in the database.
I'm trying to build a unit test for this without succes.
Which unit test type should i use for this case?
i've tried with update statement and update handler, but without succes.
Solved
Unit test in cp instead_of_trigger
Best answer by Renée Evertzen
Hola
The following combination should work to set up a unit test for an instead of trigger:
- Unit test type: Update statement
- Type of object: Table
- Object: the view that the instead of trigger is assigned to
If you need specific data in your view you can assign mock data to the view as well.
Checking whether the outcome of the instead of trigger is correct can then be done through the assertion query.
Hope this helps!
Kind regards,
Renée
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.