Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Build failure: System.ArgumentNullException
Rasmus
#1 Posted : Monday, May 14, 2018 7:33:00 AM(UTC)
Rank: Member

Groups: Registered
Joined: 3/17/2017(UTC)
Posts: 13
Location: Denmark

Was thanked: 2 time(s) in 2 post(s)
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
Remco
#2 Posted : Monday, May 14, 2018 7:53:08 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,328

Thanks: 700 times
Was thanked: 866 time(s) in 824 post(s)
Hi Rasmus,

Thanks for posting!

Can you confirm whether you're running the latest version of NCrunch? We fixed a problem with exactly this description in v3.15.
Rasmus
#3 Posted : Monday, May 14, 2018 9:05:52 AM(UTC)
Rank: Member

Groups: Registered
Joined: 3/17/2017(UTC)
Posts: 13
Location: Denmark

Was thanked: 2 time(s) in 2 post(s)
Ooops no, I am on 3.14. Must have missed an upgrade notification. Will upgrade, sorry for the noise.
1 user thanked Rasmus for this useful post.
Remco on 5/14/2018(UTC)
Rasmus
#4 Posted : Wednesday, May 23, 2018 12:11:59 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/17/2017(UTC)
Posts: 13
Location: Denmark

Was thanked: 2 time(s) in 2 post(s)
Upgraded to 3.16, get a different error now

System.ArgumentException: Object of type 'System.Int32' cannot be converted to type 'System.Nullable`1[Iit.Crm.Onboarding.Api.Proxy.DataContract.TriState]'.
at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at nCrunch.TestExecution.Reflection.Clr.ClrMethod.Invoke(Object instance, Object[] parameters)
Remco
#5 Posted : Wednesday, May 23, 2018 7:56:39 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,328

Thanks: 700 times
Was thanked: 866 time(s) in 824 post(s)
Do you experience this problem when changing your Framework Utilisation Type for MSTest to 'DynamicAnalysis'?
Rasmus
#6 Posted : Thursday, May 24, 2018 6:38:42 AM(UTC)
Rank: Member

Groups: Registered
Joined: 3/17/2017(UTC)
Posts: 13
Location: Denmark

Was thanked: 2 time(s) in 2 post(s)
No, that did it.
1 user thanked Rasmus for this useful post.
Remco on 5/24/2018(UTC)
Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.036 seconds.