Zoomed Image

AMSX Scripting Language - Command : test.count

Summary

Assert that the number of rows in a table matches an expected count

Description

Counts rows in the specified table matching the optional WHERE clause, then compares the count against the expected value. Throws an exception if the comparison fails. The expected value can include a comparator prefix such as >=, <=, <>, >, or <. In the error message, use $filter, $table, $count, and $expectedcount as substitution tokens.

Parameters

ParameterDescription
cmdtable name to count rows in
Argument 0WHERE clause (without the WHERE keyword), or leave blank to count all rows
Argument 1expected count, optionally prefixed with a comparator (e.g. >=5, <>0)
Argument 2error message to raise if the assertion fails (supports $filter, $table, $count, $expectedcount tokens)

Syntax


Test.Count "table name to count rows in", "WHERE clause (without the WHERE keyword), or leave blank to count all rows", "expected count, optionally prefixed with a comparator (e.g. >=5, <>0)", "error message to raise if the assertion fails (supports $filter, $table, $count, $expectedcount tokens)"

Return to the AMSX Command Reference