开发者

Is there a more robust way to integration test my persistance layer app.config?

开发者 https://www.devze.com 2022-12-20 06:27 出处:网络
I have my application broken into the following projects/assemblies Approot/UI AppDomain/business logic/layer

I have my application broken into the following projects/assemblies

  • Approot/UI
  • AppDomain/business logic/layer
    • Domain.Tests
  • Persistance/db layer
    • Persistance.Tests

I'm integration testing the connection string stored开发者_开发技巧 in the Persistance assembly using MSTest. currently I am using LocalTestRun.config for the solution to tell it to include the Persistance layer's app.config file for testing, but I imagine this will not work well if any other layers have an app.config file in their test sections. How is this supposed to be set up? ConfigurationManager.GetSection(assemblyName?).

What does adding [DeploymentItem("app.config")] do for the test method?

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

精彩评论

暂无评论...
验证码 换一张
取 消