Hi,
I am working on a large'ish solution for a bank (=> I cannot share too much code). A recent update of a test project caused NCrunch to fail for that project with
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)
at nCrunch.Module.MSTest.Integration.MSTestStaticDiscoverer.resolveDataRowParameters(ReflectedAttribute dataRowAttribute)
at nCrunch.Module.MSTest.Integration.MSTestDynamicDiscoverer.<>c__DisplayClass7_0.<FindFrameworkTestsInAssembly>b__1()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Common.PerformanceTracking.PerfTracker.TryTrackActivity(String name, Action activity)
at nCrunch.Module.MSTest.Integration.MSTestDynamicDiscoverer.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies)
at nCrunch.TestExecution.TestFinder..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.TestExecution.TestFinder..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, DescribedTestFrameworkDiscoverer[] describedDiscoverers, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies)
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.DiscoverTests(TestFrameworkDescription[] applicableTestFrameworks, ComponentUniqueName testComponentUniqueName)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters , FilePath , BuildOutput , DirectoryPath[] , FilePath[] )
at nCrunch.Compiler.RemoteBuildRunner..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters )
The problematic code seems to be
[DataRow(TriState.NotSet, null)]
[DataRow(TriState.False, false)]
[DataRow(null, null)]
[DataRow(TriState.True, true)]
[DataTestMethod]
public void When_hin_account_set_with_given_state_map_to_valid_value(TriState? hinAccountState, bool? expectedResult)
{
....
}
where TriState is an external datacontract defined as
[System.Runtime.Serialization.DataContract(Name = "TriState")]
[Serializable]
public enum TriState
{
[EnumMember] NotSet,
[EnumMember] True,
[EnumMember] False,
}
Is there something I can do to make NCrunch happy about this?
Cheers,
Rasmus