Similar to
http://forum.ncrunch.net...ith-question-marks.aspx
We have unit tests categorised based on test function, e.g. unit, integration, and so forth.
Using NCrunch 2.5.0.12, the categories are detected & visible in the NCrunch Tests window. Using an engine mode of "DoesNotHaveCategory 'Integration'", the 'integration' tests are run in any case.
The issue has been reproduced in a single project VS 2013 solution, with the following file:
Code:
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace NCrunch_MSTest
{
[TestClass]
public class Fixture
{
[TestMethod]
[TestCategory("Integration")]
public void CategorisedIntegration_ShouldNotRun()
{
Assert.Fail("Integration test: should not run.");
}
[TestMethod]
[TestCategory("Unit")]
public void CategorisedUnit_ShouldRun()
{
// NOP.
}
[TestMethod]
public void Uncategorised_ShouldRun()
{
// NOP.
}
}
}
NCrunch solution file:Code:
<SolutionConfiguration>
<FileVersion>1</FileVersion>
<AllowParallelTestExecution>true</AllowParallelTestExecution>
<AllowTestsToRunInParallelWithThemselves>true</AllowTestsToRunInParallelWithThemselves>
<FrameworkUtilisationTypeForNUnit>UseDynamicAnalysis</FrameworkUtilisationTypeForNUnit>
<FrameworkUtilisationTypeForGallio>UseStaticAnalysis</FrameworkUtilisationTypeForGallio>
<FrameworkUtilisationTypeForMSpec>UseStaticAnalysis</FrameworkUtilisationTypeForMSpec>
<FrameworkUtilisationTypeForMSTest>UseStaticAnalysis</FrameworkUtilisationTypeForMSTest>
<EngineModes>Run all tests automatically:BFRydWU=:BFRydWU=:BFRydWU=:False;Run all tests manually:BUZhbHNl:BFRydWU=:BFRydWU=:False;Run impacted tests automatically, others manually:CklzSW1wYWN0ZWQ=:BFRydWU=:BFRydWU=:False;Run pinned tests automatically, others manually:CElzUGlubmVk:BFRydWU=:BFRydWU=:True;Not categorised as "Integration":E0RvZXNOb3RIYXZlQ2F0ZWdvcnkLSW50ZWdyYXRpb24=:BFRydWU=:BFRydWU=:False</EngineModes>
<MetricsExclusionList>
</MetricsExclusionList>
</SolutionConfiguration>
NCrunch project file:Code:
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<AllowCodeAnalysis>false</AllowCodeAnalysis>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<DetectStackOverflow>true</DetectStackOverflow>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>60000</DefaultTestTimeout>
<UseBuildConfiguration />
<UseBuildPlatform />
<ProxyProcessPath />
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>
* referencing "c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll"