Skip to content
Simple framework for SQL Unit Testing in Visual Studio
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Simple SQL Unit Testing Framework

Framework that greatly simplifies the development of SQL Unit Tests in Visual Studio.


Everyone that has used the SQL Unit Tests feature of Visual Studio will know that is far from perfect. The main problems being the weird bugs that prevent properly saving the files, and the cumbersome way of specifying the assertions. Other benefits are:

  • No RESX!
  • Work directly with MSTest test classes.
  • Assertions for a whole table (no more Scalar Value Conditions for each of your cells!)
  • Fluent and terse assertions.
  • You can paste results from SSMS directly into your assertion.
  • Outputs joined SQL.
  • Base classes for wrapping your test in a rollbacked transaction, either local or distributed.

Getting started

using Microsoft.VisualStudio.TestTools.UnitTesting;
using SimpleSqlUnitTesting

namespace MyTests
    public class MyTestClass : LocalTransactionSqlTest
        public MyTestClass()
            TestInitializeAction = Actions.CreateSingle(

        public void MyTestMethod()
            .ResultsetShouldBe(1, @"
11	1	0.143	7
22	2	0.286	7
55	3	0.429	7
66	4	0.571	7
77	5	0.714	7
88	6	0.857	7
133	7	1.000	7")
            .ResultsetShouldBe(2, "6"));


Please provide feedback and ask questions here.

You can’t perform that action at this time.