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

Notification

Icon
Error

How to configure NUnit file to execute test cases of a solution file.
dotnettestuser
#1 Posted : Monday, September 21, 2015 2:21:06 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/21/2015(UTC)
Posts: 1
Location: India

Hi,

We have a Visual Studio solution file and it contains around 60 projects. We created a "AllTests.config" and "AllTests.Nunit" files
as a solution items. Here, the "AllTests.Nunit" file to execute the test cases of all the projects and "AllTests.Config" file has
configuration details. Normally, when we invoke "AllTests.Nunit", it loads the test fixtures of all projects and execute the test
cases.

Right now, we are exploring NCrunch and it has isolated storage for each project and executes the test cases there it self.
But, we are getting the error because it expecting the configuration file. So, I have added the above 2 files (i.e. AllTests.Config, AllTests.Nunit)
but still we are getting the same error. I believe that, NCrunch process expecting the configuration file name should be
match with project name like (i..e abc.csproj, abc.config).

Please help, how to configure the configuration file and ".Nunit" files to execute all test cases of a solution.

Thanks
akb
Remco
#2 Posted : Monday, September 21, 2015 9:11:19 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi akb, thanks for posting!

When NCrunch creates a test runner to run your tests, it follows the standard .NET convention by loading the config file which has the same name as the test assembly. This means that for the AllTests.Config file to be used by NCrunch, you'll need to rename this and ensure it is copied into the build output directory.

I would recommend doing this using a post-build step in each project, and ensuring that your post-build steps are enabled in your NCrunch configuration (NCrunch will usually suppress them). You can do this fairly generically using MSBuild properties, for example:

copy "$(ProjectDir)AllTests.config" "$(ProjectDir)$(OutDir)$(AssemblyName).dll.config"

NCrunch itself cannot make use of the .nunit file. To my knowledge, this file is a simple project list used by the NUnit GUI and isn't required by NCrunch, which is able to obtain the list of test projects directly from VS.
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.025 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download