Today while working on some regression build issues, me and my lead noticed one problem with MS Tests, we are running MSTest.exe from commandline to execute few tests. The problem was MSTest.exe was is not copying all the referenced assemblies to the Out folder, and this is causing failures. We initially thought the issue with commandline MSTest.exe, because all these test cases were running fine, when we run same using Visual Studio IDE. All the required assemblies are referenced to the test project, because of that we didn’t tried the DeploymentItem attribute. We tried the various MSTest commandline switches, but nothing worked. Later we found the issue, it was because of the referenced assemblies was not being used in the test. The problem fixed by creating instance of the all required assemblies in the test cases.
Thanks to Raghu Happy unit testing.