Start of Content Area
constraint (BC-ABA)

ABAP Runtime Environment (BC-ABA)

In ABAP Unit testing, a constraint specifies a condition that must be met. A constraint applies to a data object that is changed or produced by the module that is being tested.

A constraint may specify, for example, that a data object returned by a module is a number between 1 and 10, or that a data object is a bound reference to an ABAP class.

Constraints are specified by creating a class that extends the ABAP IF_CONSTRAINT interface. A number of standard implementations or IF_CONSTRAINT are available. These can be used to specify and check constraints in conjunction with the ASSERT_THAT method of class CL_ABAP_UNIT_ASSERT.

End of Content Area