There are two types of assertions: Unary assertions and Binary Assertions.
Unary assertions evaluate a single resource, which is self-sufficient to perform the check.
Binary assertion compare two resources (usually the actual resource given as result to an execution to the resource which was expected.
Let's have a look at the following instructions:
ASSERT result.sah IS success
ASSERT actual.dbu DOES contain THE expected.dbu
success is a unary assertion of the type SahiIsSuccess, which evaluate a SahiSuiteResource,
contain is a binary assertion of the type DbUnitDatasetContains, which compare two DbUnitDatasetResource.
All the Unary Assertion needs to be annotated @TAUnaryAssertion("NAME")
NAME is the name given to the ASSERT instruction.
All the Unary Assertions must implement the interface UnaryAssertion<ACTUAL>
ACTUAL is the type of the resource the assertion must judge.
For example, the unary assertion SahiIsSuccess which was spoken of above is defined as:
@TAUnaryAssertion("success")
public class SahiIsSuccess implements UnaryAssertion<SahiSuiteResultResource>
All the Binary Assertion needs to be annotated @TABinaryAssertion ("NAME")
NAME is the name given to the ASSERT instruction.
All the Binary Assertions must implement the interface BinaryAssertion<ACTUAL, EXPECTED>,
ACTUAL and EXPECTED are the type on the resources the assertion must compare.
Note: Most of the time, ACTUAL and EXPECTEDwill be of the same resource type, but it is not mandatory (see for example ShellStreamContains).
For example, the binary assertion DbUnitDatasetContains which was spoken of above is defined as:
@TABinaryAssertion("contain")
public class DbUnitDatasetContains implements BinaryAssertion <DbUnitDatasetResource, DbUnitDatasetResource>