【问题标题】:Separate Database for Integration Testing用于集成测试的独立数据库
【发布时间】:2010-03-27 04:57:17
【问题描述】:
我正在进行性能集成测试,我使用 WatiN 启动 ASPX 页面并填写字段并插入数据库。我面临几个问题。
1) 我应该使用完全独立的数据库进行集成测试吗?我已经给了 db_test 和 db_dev。 db_test 用于单元测试,每次测试后清除。 db_dev 适用于开发人员。
2) 当我运行包含在单独程序集中的 WatiN 测试时(不与单元测试程序集分开,这应该更好,因为 WatiN 测试需要很长时间才能运行)。因此,WatiN 测试启动了 WebApps 项目并使用他们的 web.config 指向 dev 数据库。无论如何我可以告诉 WatiN 使用包含不同数据库名称的单独 web.config 吗?
【问题讨论】:
标签:
testing
integration-testing
watin
【解决方案1】:
您可以使用 Web 部署项目来切换 web.config 文件。
<Copy SourceFiles="$(OutputPath)web_Staging.config" DestinationFiles="$(OutputPath)web.config" Condition="'$(Configuration)|$(Platform)' == 'Staging|AnyCPU'" />
<Copy SourceFiles="$(OutputPath)web_Release.config" DestinationFiles="$(OutputPath)web.config" Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
<Delete Files="$(OutputPath)web_Staging.config" />
<Delete Files="$(OutputPath)web_Release.config" />
http://www.microsoft.com/downloads/details.aspx?familyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en