1

I'm working on a .NET solution with many test projects that uses a post-build step to move all the solution's outputs to a different folder which is the only location accessible for my testing.

When running nunit-console I can specify the different projects DLLs but then i need to know each one... I would rather just specify the solution itself but can't as the projects specified OutputPath is different than the actual DLL locations.

Alternatively I've tried working with an NUnit project file but again it seems like I have to specify each assembly location - I wonder if there is an easier way to point nunit for a specific location for all assemblies.

Looking at the NUnit docs it seems like I should be able to define the Config element to use the binpath attribute, however using it without including at least one assembly results in "File type not supported" error:

enter image description here

NikolaiDante
  • 18,469
  • 14
  • 77
  • 117
Roy
  • 11
  • 2

1 Answers1

0

You haven't installed the engine extension that is able to interpret nunit projects. You can find it at nuget.org: https://www.nuget.org/packages/NUnit.Extension.NUnitProjectLoader/

In addition, your nunit project file has a few things wrong with it:

  1. It doesn't list any test assemblies! They have to be listed to be run.

  2. You are telling NUnit to use an absolute path for the private binpath and also to automatically deduce the private bin path, which is the default.

  3. You should locate your .nunit file in the base directory containing the assemblies and just use relative paths for each assembly.

Here is a sample project file with the minimal setings you need:

<NUnitProject> <Config name="Default"> <Assembly path="my.test.dll"/> ... </Config> </NUnitProject>

Such a project could easily be included in the source and deployed to the test location along with all the assemblies.

Charlie
  • 12,928
  • 1
  • 27
  • 31
  • Actually when I list at least one test assembly it works as expected (so i'm guessing its not a missing extension issue, only minimal requirement for nunit project file to load), the real question is whether I can omit listing specific assemblies and just ask for all the relevant assemblies to be found in a specific location and not as listed in the c# solution/project files listed as the nunit3-console inputs. – Roy May 23 '17 at 08:39
  • No, the nunit project file is a way of listing your assemblies together with certain options for loading them. It isn't aimed at finding all the assemblies in a directory. – Charlie May 24 '17 at 09:54