此部分内容创建一个轻量级T-SQL测试套件,总共有3个脚本。
用于创建测试平台数据和待测存储过程的脚本:
--====================== use master if exists (select * from sysdatabases where name = 'DbTestAndResults') if exists (select * from sysxlogins where name = 'testLogin') create database makeDbTestAndResults use makeDbTestAndResults create table tb1TestCases --下面插入的是用于usp_HiredAfter的测试数据,采用了对期望值求校验和的方法 insert into tb1TestCases values('0001','10/25/2009',1042032) create table tb1Results exec sp_addlogin 'testLogin','secret' exec sp_grantdbaccess 'testLogin' grant select,insert,delete,update on tb1TestCases to testLogin grant select,insert,delete,update on tb1Results to testLogin --结束脚本 |