Syntax
tSQLt.AssertEqualsTableSchema [@Expected = ] 'expected table name' , [@Actual = ] 'actual table name' [, [@FailMsg = ] 'message' ]
Arguments
[@Expected = ] expected table nameThe name of a table with the expected columns (and data types). @Expected is NVARCHAR(MAX) with no default.
[@Actual = ] actual table name
The name of a table created as the result from processing during the test. @Actual is NVARCHAR(MAX) with no default.
[@FailMsg = ] ‘message’
Optional. String containing an additional failure message to be used if the expected and actual values are not equal. @FailMsg is NVARCHAR(MAX) with a default of ‘unexpected/missing resultset rows!’.
Return Code Values
Returns 0
Errors Raised
Raises a ‘failure’ error if the contents of the expected table and the actual table are not equal.
Result Sets
None
Overview
AssertEqualsTableSchema works like AssertEqualsTable, but instead of comparing the table contents, it compares the table compares the table schemata.
Under the covers, AssertEqualsTableSchema calls AssertEqualsTable on the table metadata. For details of how to interpret its output, check out the AssertEqualsTable documentation.