Lookup matches

A lookup-matches test must be considered when you want to be sure that some values found in a the candidate result-sets are the same than values found in the reference result-sets.

At the opposite of equivalence’s tests, lookup’s tests don’t require the uniqueness of the rows in the reference or candidate result-sets. If a row from the candidate result-set has one or more matching keys in the reference table then the values associated to one of these matches must be equal in the reference result-set and candidate result-set. If a row from the candidate result-set has no matching key in the reference result-set, it’s not considered as an issue for the test and this row will be considered as successful.


The system under-test is any result-set representing the candidate table.


The assertion is defined by the xml element lookup-matches. Some parts of the assertion are identical to the parts defined for the lookup-exists test. See jointure and Reference result-set for more information.


In addition to the keys defined in the join element, the test is expecting to define the values that must be compared int the two result-sets. At the moment, NBi is supporting strict equality and is not supporting tolerance when comparing the values of the reference and candidate result-sets.

The definition of the mapping between the columns of the two result-sets are defined with the help of the mapping or using elements.

      <mapping candidate="DepartmentID" reference="Id" type="numeric"/>
      <mapping candidate="DepartmentName" reference="Name" type="text"/>
        select [DepartmentID] as Id, [Name] from [HumanResources].[Department]