shekharpro / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

NUnit SetupFixture requires disabling namespace flattening. #477

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Jeff and Charlie,
I've been having exactly this same issue and have done a little digging and
believe that the issue is that NUnit's Test Structure option needs to be
set to "Automatic Namespace" as described on stackoverflow [1] however I
haven't been able to find out how to do this yet or if it's even possible
from inside Gallio? As Charlie mentioned this is not a new feature and has
been about since 2.4.6 [2].

Other details that may be relevant:
Warning message:
 "SetUpFixture cannot be used when loading tests as a flat list of fixtures"

Resources:
[1] http://stackoverflow.com/questions/41858/nunit-setupfixture-never-runs
[2] http://nunit.com/index.php?p=setupFixture&r=2.4.6

Cheers,
Charles.

Original issue reported on code.google.com by jeff.br...@gmail.com on 20 Jun 2009 at 12:40

GoogleCodeExporter commented 9 years ago
I've attached a patch that addresses the very particular spot that's in 
contention.  
I've done no testing other than to verify that the mb-unit solution builds 
(including 
Icarus and nunit 2.5 integration), and that my test suite will now run 
correctly 
under both the nunit-gui test runner and Icarus.

This patch is against trunk (revision 1937).

At least one of the relevant places in Nunit 2.5.0.9122 seems to be:
src\NUnitCore\core\TestSuiteBuilder.cs:86

There are probably others.  I'm not an NUnit developer.  "AutoNamespaceSuites" 
seems 
to drive whether SetUpFixture's get attached at namespace nodes or not.  No 
namespace, no way to say when a particular SetUpFixture for a particular would 
apply 
or should be invoked.  

Original comment by storycra...@gmail.com on 22 Jun 2009 at 8:35

Attachments:

GoogleCodeExporter commented 9 years ago
Done in v3.1.  Turns out the change was a little more involved than just 
turning on
the auto-namespaces flag.

Original comment by jeff.br...@gmail.com on 18 Jul 2009 at 5:00