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

Notification

Icon
Error

NCrunch fails unit test where MSTest passes
Queck
#1 Posted : Tuesday, May 13, 2014 12:38:35 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/13/2014(UTC)
Posts: 6
Location: Germany

Was thanked: 1 time(s) in 1 post(s)
Hi,

I am new to NCrunch and started to evaluate it today.
I have a issue, that NCrunch can not run a unit test which on the other hand runns without problem when using MSTest.
The code NCrunch is complaining about (reporting a ArgumentNullException:

var usfFileName = Path.Combine(this.TestContext.TestRunDirectory, "testUsf.usf");

How can this line cause a ArgumentNullExceptione?
Unless NCrunch as a problem with MSTest - TestContext....

Regards
Rainer
Remco
#2 Posted : Tuesday, May 13, 2014 11:13:14 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Rainer -

NCrunch's MSTest support is emulated rather than integrated, so the properties available on the TestContext need to be declared by NCrunch specifically in order for them to be available to your tests.

It looks like you've managed to find a property that hasn't been set (and should be), so this is basically a hole in the support.

I've noted this down to be fixed. There should be a number of ways to work around this problem - check whether the TestContext contains any other properties with the same value (many of them are duplicates). You may also be able to obtain the test run directory using System.IO.Directory.GetCurrentDirectory(), or using the location of the test assembly - System.IO.Path.GetDirectoryName(this.GetType().Assembly.Location)
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.026 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download