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

Notification

Icon
Error

xUnit Collection Fixtures
sqdcm
#1 Posted : Friday, March 27, 2015 5:47:11 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/27/2015(UTC)
Posts: 4

To me it seems that currently Collection Fixtures are not at all supported.

Any test class that attempts to use them instantly fail with an error similar to:

Code:
Xunit.Sdk.TestClassException: The following constructor parameters did not have matching fixture data: DatabaseFixture fixture


However, running them in the xUnit Visual Studio or Console runner works just fine.

Is there some setup piece that I am missing to make these work?
Remco
#2 Posted : Friday, March 27, 2015 10:42:56 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, can you share any sample code that can reproduce this issue?

Cheers,

Remco
sqdcm
#3 Posted : Monday, March 30, 2015 2:50:21 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/27/2015(UTC)
Posts: 4

The sample code from the Collection Fixtures section of the documentation doesn't even work for me with NCrunch. Copy pasting that code, and adding a useless Fact was the first thing I tried to make sure that it was failing in my main problem wasn't a syntax error on my part somewhere.

I can copy paste that example code here if you really need it, but I only added a function with Assert.Equal(1,1) in it.
Remco
#4 Posted : Monday, March 30, 2015 11:00:10 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)
Thanks, I can see this issue now. It seems to appear for me when using the framework with static analysis.

Can you check whether the 'Framework utilisation type for XUnit V2+' solution-level configuration setting is set to 'DynamicAnalysis'?

Also, can you confirm which versions of NCrunch and XUnit you are running?
sqdcm
#5 Posted : Tuesday, March 31, 2015 7:10:57 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/27/2015(UTC)
Posts: 4

It's not something I have ever changed, and it is indeed set to UseDynamicAnalysis. Now that I am aware of the option, changing it to UseStaticAnalysis actually seems to make NCrunch unable to see any of the tests, and it reports that it is monitoring no tests.

For xUnit, I am using the 2.0.0 version off NuGet. However, I have tried 2.1.0-beta and get the same issue.

NCrunch I am using 2.13.0.5.
Remco
#6 Posted : Wednesday, April 1, 2015 4:52:14 AM(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)
I've just pushed out a new version of NCrunch (v2.14.0.8) which includes re-integration with the latest version of Xunit V2.

Would you be interested in giving it a try to see if it solves this problem for you? http://www.ncrunch.net/download.
sqdcm
#7 Posted : Wednesday, April 1, 2015 3:03:45 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/27/2015(UTC)
Posts: 4

It does indeed, thank you.
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.037 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download