Skip to main content
Open

Unit test for triggers should pass input as parameters

Related products:Software Factory
  • September 1, 2023
  • 1 reply
  • 26 views

Arjan Sollie
Thinkwise blogger

When setting up a unit test for a trigger the input you set up is not passed on as parameter. Instead, it is only available in the insert statement values list (hardcoded). This makes is super difficult to set up an assertion using the input parameters. 

Therefor the only way to check your inserted data is setting up a hardcoded assertion query, which is not what you want. Because if you change an input parameters you also need to change the assertion query.

A unit test for triggers should pass the input as parameters. These parameters can be using in the insert statement and then also be used in your assertion query.

Currently example below is not possible. This should be possible.

 

Did this topic help you find an answer to your question?

1 reply

Jeroen van den Belt
Administrator
Forum|alt.badge.img+9
NewOpen

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings