有没有更健壮的方法来集成测试我的持久层app.config?

时间:2010-02-17 17:50:28

标签: mstest integration-testing configuration-files

我将我的应用程序分解为以下项目/程序集

  • 为approot / UI
  • AppDomain /业务逻辑/图层
    • Domain.Tests
  • 持久性/ db层
    • Persistance.Tests

我正在使用MSTest集成测试存储在Persistance程序集中的连接字符串。目前我正在使用LocalTestRun.config来解决它告诉它包含Persistance层的app.config文件进行测试,但我想如果任何其他层在其测试部分中都有app.config文件,这将无法正常工作。这应该怎么设置? ConfigurationManager.GetSection(assemblyName?)

添加[DeploymentItem(“app.config”)]为测试方法做了什么?

    [TestMethod]
    [DeploymentItem("app.config")] // I added this to see if it would help somehow
    public void Configuration_ConnectionStrings_Connect()
    {
    //code omitted
    }

0 个答案:

没有答案
相关问题