Re: Need Feedback: RequiredAddinAttribute

Cory Foy <[email protected]> Wed, 16 Jul 2008 22:45:30 -0400
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
Charlie Poole wrote:
> It seems "intuitive" that you could write "[MyTest,
> RequiredAddin("MyTestAddin")] 
> and have NUnit give you some kind of report, but it's not that obvious how
> NUnit
> could distinguish it from [MySetUp, RequiredAddin("MySetUpAddin")] assuming
> each is on a method with the same signature.

For some reason, the RequiredAddIn just feels like overkill. I mean, I 
get that the AddIn may not be accessible at run time. But it feels like 
we are exposing plumbing of NUnit code out. In other words, when else 
would this be useful outside of having NUnit AddIns?

It seems there are a couple of ways we could also handle it. First, if 
we are going to go with this, I like the idea of being assembly-level 
only. Second, perhaps we could just do a configuration-thing where one 
would list the add-ins they are using in the config file, and the first 
thing the GUI does is validate that all of the AddIns are present, 
stopping the run if they aren't.

It also seems like you could just have:

[Test]
public void TestAddInsPresent()
{
   Assert.AddInPresent("MyTestAddIn");
   Assert.AddInPresent("MySetUpAddin");
}

Or even have it as part of setup. Seeing this:

assembly:RequiredAddin("MyTestAddin");

while it is readable, makes me not as sure. Perhaps if it said 
"assembly:RequiredNUnitAddIn" I'd feel better. Well, slightly anyway. ;)

-- 
Cory Foy
http://www.cornetdesign.com
http://www.agileflorida.com

-------------------------------------------------------------------------
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=/