VS2012 & TFS2012 Unit Test major issues

前端 未结 1 2052
心在旅途
心在旅途 2021-02-08 00:36

We are using VS2012 and TFS2012 and write unit tests for our code. We want to report code coverage, and also using .config files in our unit tests for test appsettings, and also

1条回答
  •  别跟我提以往
    2021-02-08 00:52

    a) App.config not working in new test framework

    This should still work. What I think is missing in this case is that this .config file is not being copied with your test dll. Could you please set this as a deployment item and try again?

    b) Do not use the .testSettings file

    • .testsettings and code coverage. Setting up code coverage with the .testsettings file IS still supported in VS 2012 build. You simply need to select the mstest 2010 test runner and specify your .testsettings file in your build definition

    If you dont have anything except code coverage settings in the .testsettings file then you can easily migrate to the 2012 test runner and select "enable code coverage" in the drop down items

    • copying a file required by test initalize You could do this via the .testsettings file or you can have a post-build file copy task. It is pretty straight forward to do so and has no impact on anything else. Using the "copy to output directory = copy always" does work. Please try it with a sample solution and see if you can narrow down on why this does not work on your setup.

    0 讨论(0)
提交回复
热议问题