tSQLt-org / tSQLt

The official tSQLt repository. (Download at: http://tSQLt.org/downloads )
http://tSQLt.org
413 stars 102 forks source link

AssertObjectExists could also check for the type of object #195

Open mverbaas opened 1 year ago

mverbaas commented 1 year ago

AssertObjectExists could also check of the object type. Now you can miss a test if there is, for example a table and a view with the same name.

CREATE TABLE dbo.orders (c1 int)

and

CREATE VIEW dbo.orders as SELECT c1 FROM dbo.orders

Both would succeed with EXEC tSQLt.AssertObjectExists @ObjectName = N'dbo.orders'

Adding an optional type checker U or V could maybe make the assertion more specific.