Re: detecting excluded categories when running the tests

"Charlie Poole" <[email protected]> Tue, 22 Jul 2008 18:02:36 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <006801c8ec5f$ce35a6d0$6401a8c0@ferrari>
There's really no way to do that - in fact we kind of take
pains to keep the tests from knowing much about who is
running them and how. :-)

It sounds as if you may not be aware that SetUpFixture
is namespace-specific. So you can just put all the tests
that require database setup into a sepatate set of fixtures
in their own namespace and then add the setup fixture class
to the same namespace.

Charlie 

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf 
> Of Laimonas Simutis
> Sent: Tuesday, July 22, 2008 1:51 PM
> To: [email protected]
> Subject: [Nunit-users] detecting excluded categories when 
> running the tests
> 
> Is there a way to detect which test categories were excluded 
> from unit test code itself?
> 
> For instance, I have this code:
> 
> [SetUpFixture]
> public class TestDataSetup()
> {
>     [SetUp]
>     public void FixtureSetUp()
>     {
>         if ( !excludedList.Contains("Database"))
>         {
>             SetupTestDB();
>         }
>     }
> }
> 
> 
> If not, would my best option be create another project just 
> for the database tests and in there the SetUpFixture SetUp 
> would contain
> SetupTestDB() code?
> 
> Thanks,
> 
> L
> 
> --------------------------------------------------------------
> -----------
> This SF.Net email is sponsored by the Moblin Your Move 
> Developer's challenge Build the coolest Linux based 
> applications with Moblin SDK & win great prizes Grand prize 
> is a trip for two to an Open Source event anywhere in the 
> world http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Nunit-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nunit-users
> 



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/