Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tsqlt - create separate database for unit testing

Tags:

tsql

tsqlt

I have started using tsqlt, and my question is it possible to have a separate database with just the testing stuff? (tables/sp's/assemblies etc).

This testing database will sit on the same instance as the actual/target database.

If I try to fake a table I get the following error:

FakeTable could not resolve the object name, 'target_db.dbo.Sometable'

Has anyone had any experience with this?

Thanks.

like image 451
Umair Avatar asked Nov 21 '12 15:11

Umair


1 Answers

As you discovered, this isn't currently possible as the mocking procedures don't accept three part names. This is something that's been covered at the User feedback forums of SQL Test (RedGate's product that acts as a front end to tSQLt) at : http://sqltest.uservoice.com/forums/140716-sql-test-forum/suggestions/2421628-reduce-the-footprint

Dennis Lloyd, one of the authors of the tSQLt framework wrote towards the end of that thread that support of a separate 'tSQLt' database was something they would keep under consideration.

Also a related issue of mocking remote objects at http://sqltest.uservoice.com/forums/140716-sql-test-forum/suggestions/2423449-being-able-to-mock-fake-remote-objects

I hope that helps,

Dave

like image 52
DaveGreen Avatar answered Oct 15 '22 10:10

DaveGreen