Questions tagged [tsqlt]

tSQLt – The Database Unit Testing Framework for SQL Server

tSQLt is a database unit testing framework for Microsoft SQL Server. tSQLt is compatible with SQL Server 2005 (service pack 2 required) and above on all editions. It is available at tSQLt.org

204 questions
3
votes
1 answer

The best way to insert data to tSQLt faketable?

I am quite new to tSQLt database unit testing framework. I have a stored procedure that uses 3 tables. Each table needs 15 rows of data. I also need another fake table to validate the result. But it’s error-prone and hard to maintain to use INSERT…
user4143172
3
votes
3 answers

Exposing tSQLt as NUnit tests

Is there any way to expose tSQLt tests inside Visual Studio, in a similar way to NUnit? Even better, so all the tests in a solution can be run using Resharper ... I'm aware of Red Gates SQL Test product, but it only seems to target SSMS
SteveC
  • 15,808
  • 23
  • 102
  • 173
3
votes
1 answer

tSQLt projects fail to build in Visual Studio 2012

I have a number of database projects using tSQLt that build correctly in Visual Studio 2010. When I open them in Visual Studio 2012, I'm informed that the IDE has to make "functional changes" in order to use them. Once I let the conversion go…
Yes - that Jake.
  • 16,725
  • 14
  • 70
  • 96
3
votes
2 answers

Bamboo with tSQLt - Failed to parse test result file

First of all I should point out I'm new to Atlassian's Bamboo and continuous integration in general. This is the first project where I've used either. I've created a raft of unit tests using the tSQLt framework. I've also configured Bamboo to: Get…
user12925
  • 471
  • 5
  • 6
3
votes
1 answer

TSQLT unit test - The data types text and text are incompatible in the equal to operator

I am getting this error from AssertEqualsTable "The data types text and text are incompatible in the equal to operator." then "The 'TableCompare' procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned…
JDPeckham
  • 2,414
  • 2
  • 23
  • 26
3
votes
1 answer

What version of tSQLt (Database Test Framework) have I installed?

Is there any way I can find the version number of tSQLt that is installed on a database? Please note that tSQLt is a test framework for SQL server, not T-SQL. (don't vote to close as duplicate of something unrelated, please.)
steenhulthin
  • 4,553
  • 5
  • 33
  • 52
2
votes
2 answers

Why does the first tSQLt sample test fom Red Gate SQL Test fail on my system?

I recently installed the SQL Test plug-in on a virtual machine (VMWare 8) running SSMS for SQL Server 2008 R2. This is a front end for tSQLt. I enabled CLR on the server. I installed the tSQLt sample database. I hit the Run button. I expect all…
2
votes
1 answer

VS 2022 17.5.1 Project contains a reference to a project which is unloaded

I have upgraded from VS 2019 Community Edition to VS Community 2022 17.5.1. When trying to build the project, the system complains with various errors. These errors seem related to database references as they are appearing with a yellow icon. When I…
2
votes
1 answer

Setup Azure SQL database unit test DevOps environment with tSQLt

Environment Server with Azure SQL Local with SQL Server Express Database deploy with SSDT The plan [Developer] Run database unit test locally on SQL Server Express during development [DevOps] Once developer commit the changes, run all unit test…
2
votes
2 answers

Any tool to test SQL Server Stored Procs when data is not available in the database.

Are you aware of any utility or tool which tests sql server stored procedures where data is not available in the database, may be that tool should insert data into DB by reading the stored procedure... Any suggestions ? Thanks.
sqlnewbie
  • 857
  • 3
  • 16
  • 39
2
votes
1 answer

Using TSQLT FakeTable to test a table created by a Stored Procedure

I am learning to write unit tests for work. I was advised to use TSQLT FakeTable to test some aspects of a table created by a stored procedure. In other unit tests, we create a temp table for the stored procedure and then test the temp table. I'm…
2
votes
1 answer

Programmatically generate DDL statement for User Defined Data Type (UDDT)

I'm trying to add faking synonyms pointing to remote objects support(PR) for tSQLt. To make it possible to mock/fake tables that have user defined system types in the table definitions, I need to generate the User Defined Data Type (UDDT) DDL…
2
votes
0 answers

How to Fake tables from other database in tsqlt?

I have a stored Procedure in "Database A" for which I am trying to write SQL Unit Test using tsqlt, The stored procedure uses tables from "Database B and Database c" as well from the same server. What is the syntax to Fake tables from different…
Pappu
  • 35
  • 7
2
votes
0 answers

How To Roll Back Accidental Direct Unit Test Proc Call?

I am starting to dabble in tSQLt and a few times have accidentally hit F5 and executed my test proc directly instead of through tSQLt.RunAll, which hoses my entire database. Is there any simple way to roll back that accidental execution instead of…
Thomas Parikka
  • 472
  • 5
  • 17
2
votes
1 answer

tSQLt on SQL Server 2017 AG with DTC enabled

I receive the following error when I am running tSQLt tests on SQL Server 2017 that is setup in an Always On availability group that is configured with DTC_SUPPORT = PER_DB on the AG group. If I turn off the DTC Support, it works fine. Our…
1 2
3
13 14