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

Notification

Icon
Error

Build failure when a tests is parameterized on MSTest framework. NCrunch (version 3.14.0.1)
AlexanderUK
#1 Posted : Wednesday, March 14, 2018 10:38:19 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/16/2018(UTC)
Posts: 4
Location: Ukraine

Thanks: 2 times
When I try to write one easy parameterized test, NCrunch (version 3.14.0.1) cannot build the project on VS 2017 (version 15.5.2). And that's why cannot run this test.

In output window I have next stack trace:

System.ArgumentNullException: Value cannot be null.
Parameter name: source
в System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)
в nCrunch.Module.MSTest.Integration.MSTestStaticDiscoverer.resolveDataRowParameters(ReflectedAttribute dataRowAttribute)
в nCrunch.Module.MSTest.Integration.MSTestDynamicDiscoverer.<>c__DisplayClass7_0.<FindFrameworkTestsInAssembly>b__1()
в nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
в nCrunch.Common.PerformanceTracking.PerfTracker.TryTrackActivity(String name, Action activity)
в nCrunch.Module.MSTest.Integration.MSTestDynamicDiscoverer.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies)
в nCrunch.TestExecution.TestFinder..()
в nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
в nCrunch.TestExecution.TestFinder..()
в nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
в nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, DescribedTestFrameworkDiscoverer[] describedDiscoverers, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies)
в nCrunch.Compiler.StaticManipulation.BuiltAssembly.DiscoverTests(TestFrameworkDescription[] applicableTestFrameworks, ComponentUniqueName testComponentUniqueName)
в nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters , FilePath , BuildOutput , DirectoryPath[] , FilePath[] )
в nCrunch.Compiler.RemoteBuildRunner..()
в nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
в nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters )



Can somebody help me with it or explain what is wrong? And how can I fix it on my environment?



Repro steps:
1. Create "Unit Test Project (.net core)"
2. And add this test:

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTestProject2
{
[TestClass]
public class UnitTest1
{
[TestMethod]
[DataRow(null, null)]
public void Test1(string str, int? age)
{
Assert.IsNull( age);
}
}
}
Remco
#2 Posted : Wednesday, March 14, 2018 11:45:08 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,974

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi,

Thanks for sharing this issue.

When writing parameterised data row tests using MSTest that use type conversions or nullables, please set your 'Framework utilisation type for MSTest' to 'DynamicAnalysis'. This will resolve such problems.
1 user thanked Remco for this useful post.
AlexanderUK on 3/15/2018(UTC)
AlexanderUK
#3 Posted : Thursday, March 15, 2018 10:15:41 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/16/2018(UTC)
Posts: 4
Location: Ukraine

Thanks: 2 times
Many thanks! It really helped.

I changed this option to "dynamic" and now all tests is executing correctly.

Thanks again!!!!
Users browsing this topic
Guest
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.038 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download