tSQLt-compatible unit testing framework for SQL Server 2019 and 2022.
$ dotnet add package tSQLt.EdgetSQLt-compatible unit testing framework for SQL Server 2019 and 2022. It is available as a nuget package and works perfectly with MSBuild.SDK.SqlProj project format.
This project was created in order to practice code writing in TDD. Here are some detailed principles I was followed:
tSQLt-edge is mostly fully compatible with tSQLt unit testing framework. See full user guide for more details about tSQLt.
The default method of calling tSQLt.NewTestClass to create a tSQLt test class (the schema to organize your unit tests) does not work either in Visual Studio database projects nor MSBuild.SDK.SqlProj projects. That is why tSQLt-edge entirely drop support for NewTestClass, DropClass and RenameClass.
| Status | |
|---|---|
| Fully compatible | |
| Large or partial support | |
| Unsupported |
tSQLt-edge has some additional features:
| Stored procedure | Description |
|---|---|
| ApplyIndex | Same as ApplyConstraint, but for INDEXES |
| AssertEqualsTable | Add XML column comparison using convertion to NVARCHAR(MAX) |
| AssertNotEqualsString | Same as AssertNotEquals, but for NVARCHAR(MAX) |
| FakeTable | Add @NotNulls optional parameter to preserve NOT NULLs |
| SpyProcedure | Add @CatchExecutionTimes optional parameter to catch execution times in _SpyProcedureLog |
tSQLt-edge can operate on different database, same server:
| Stored procedure with external objects support |
|---|
| ApplyConstraint |
| ApplyIndex |
| ApplyTrigger |
| AssertEmptyTable |
| AssertEqualsTable |
| AssertEqualsTableSchema |
| AssertObjectDoesNotExists |
| AssertObjectExists |
| FakeFunction |
| FakeTable |
| RemoveObject |
| RemoveObjectIfExists |
| SpyProcedure |