tSQLt.RunAll returns 0 test cases but tSQLt.Run <schema name> works

605 views Asked by At

I previously had an install of tSQLt on my database, along with some tests. I used the tSQLt.Uninstall to remove it and then deleted all the tests and the schema's they were in.

I have reinstalled tSQLt and created a new schema and created a bunch of new test stored procs. When I perform a tSQLt.RunAll I get;

+----------------------+
|Test Execution Summary|
+----------------------+

|No|Test Case Name|Result|
+--+--------------+------+
-----------------------------------------------------------------------------
Test Case Summary: 0 test case(s) executed, 0 succeeded, 0 failed, 0 errored.
-----------------------------------------------------------------------------

When I run tSQLt.Run Test_DWH_UnitTests I get results.

The tSQLt.RunAll worked against the previous install.

Any help would be very much appreciated. - Many thanks

1

There are 1 answers

0
Nick Haslam On BEST ANSWER

Have you checked that the schema is created using

EXEC tSQLt.NewTestClass '<schemaname>'

rather than just creating the test class using

CREATE SCHEMA '<schemaname>'

It'll then mark the Schema as a test class.