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

Notification

Icon
Error

Unit test "failing" in NCrunch, but passing in all other test runners.
mking
#1 Posted : Friday, October 25, 2013 5:41:30 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/14/2013(UTC)
Posts: 4
Location: Australia

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

I have a unit test that is failing in NCrunch but passing under all other test runners.

I've created a GitHub repository with more details, and a simple example that you can use to replicate the problem:
https://github.com/MatthewKing/NCrunchNancyFxBug

Problem description

I have a project using NancyFx, as well as some unit tests for that project. All of my tests pass when I use the standard test runner for my unit testing framework (I've tried both xUnit and NUnit). However, when I use NCrunch to automate my testing, any tests that involve the Razor view engine fail in NCrunch (but still pass when run with the standard test runner).

Test Results

Simple example that demonstrates the issue

https://github.com/MatthewKing/NCrunchNancyFxBug
Remco
#2 Posted : Friday, October 25, 2013 6:54:45 AM(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,

Thanks for reporting this issue and for sharing the sample code to reproduce. It's always much easier to analyse an issue like this when there is sample code available.

This issue is being caused by an assembly co-location assumption inside the Nancy framework source code. This code is expecting all assemblies to exist in the same directory when the test is run - an assumption that doesn't hold true for NCrunch unless the Copy referenced assemblies to workspace setting is set to TRUE.

Changing this configuration setting should solve the problem. Depending upon your solution structure, you may also need to change the same setting on other projects depended on by your test project.
2 users thanked Remco for this useful post.
mking on 10/25/2013(UTC), liddellj on 9/2/2014(UTC)
mking
#3 Posted : Friday, October 25, 2013 7:53:14 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/14/2013(UTC)
Posts: 4
Location: Australia

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Hi Remco,

Thanks for the prompt reply. This has completely solved my issue! Great support, as always.

I've updated the GitHub repository to include the solution and a quote from your forum post, as I had linked it elsewhere and abhor link rot. I assume you're happy to have your quote immortalized there - it not, let me know.

Thanks once again for the solution and the quick response.
Cheers!
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.036 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download