In MSTest, you can simply create two test projects (assemblies) and specify only one of the assembly configurations that will be used for testing. In MSBuild, that was the way to go. For the new WF-based build definitions, I currently don't have a sample:
<ItemGroup> </ItemGroup> <PropertyGroup> <RunConfigFile>$(SolutionRoot)\LocalTestRun.testrunconfig</RunConfigFile> </PropertyGroup>
Tip. To use the definition of a common assembly, we call all our test projects "AutomatedBuildTests", i.e. there is no difference in decisions. Thus, an assembly definition can be included in any existing assembly definition (or even be normal) that always performs the correct set of tests. It would be a daunting task to provide an if-if check to allow the assembly definition to run tests only when a test assembly is present. We do not use this to get assembly errors if a test assembly is not found, since we absolutely want to test all these assemblies that use this definition.
eFloh
source share