Unit test for triggers should pass input as parameters

Related products: Software Factory

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.

 

NewOpen