TFS UnitTesting does not deploy local copy to test dir on build server

I have an assembly that should be in the test output directory for my tests. I have an assembly referenced as a local copy in the project, but this is ignored on the assembly server. The two ways I found to fix are

  • Add a special attribute to the test method, which ensures that the file is available for each test.

    [DeploymentItem ("my build")]

    This is not very practical, since this assembly is required for almost every test in the assembly.

  • Add a test run configuration file with a special deployment section. I use TestContainer in build scripts to run tests, I think this may be the reason that my included test run configuration is not picked up and the assembly is not copied. I would prefer not to have a vsmdi test list file, as I am trying to run all the tests, and I think that would be a violation of DRY.

Any suggestions on how I can run my tests?

+4
tfs unit-testing
source share
1 answer

Since my assembly was dynamically loading, the unit test framework did not copy it. I added an explicit rejection of it, calling typeof on one of the assembly types, and everything is fine.

Thanks to Jerome Laban for helping with this.

+3
source share

All Articles