Skip to main content

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.

Hola ​@Pieter Jan Bouma , 

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


Thanks for the help! I assigned the table as object instead of the view. 
 


Awesome! Glad it worked out 😊


Reply