如何在SQL Server中对数据库进行单元测试?

时间:2020-03-05 18:50:33  来源:igfitidea点击:

有哪些方法?我们可以使用哪些框架?

解决方案

回答

好吧,我想意思是对要访问数据库的代码进行单元测试,在这种情况下,有NDbUnit,它似乎是.NET的DbUnit克隆。我从未使用过它,但是我使用过DbUnit,它非常有用。

编辑:我假设我们使用的是.NET,因为我们提到了MSSQL。但是,如果我们实际上在使用Java,则有DbUnit。

回答

这是一个执行此操作的项目:http://tsqlunit.sourceforge.net/

此外,Visual Studio Team System for DBA具有对数据库的单元测试的内置支持。

回答

T.S.T. T-SQL测试工具

TST is a tool that simplifies the task
  of writing and running test automation
  for code written in T-SQL. At the
  heart of the TST tool is the TST
  database. This database contains a
  series of stored procedures that are
  exposed as a test API. Part of this
  API is similar with those found in
  Unit Testing libraries familiar to
  programmers in C# or Java.