Re: Need Feedback: RequiredAddinAttribute

"Charlie Poole" <[email protected]> Fri, 18 Jul 2008 00:29:51 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <000501c8e8a8$13b49290$6401a8c0@ferrari>
Hi David,


For the reasons you list below, to me the "least surprise" design is to
changes this from "[RequiredAddin]" to "[LoadAddin]" where the
LoadAddin("name") attribute is required for the addin to work at all. That
way, if you have tests which at one time worked with an addin, you are
assured that they will never silently pass in the future because the addin
wasn't loaded.
 
This could be a bit confusing. If the addin is present, it's loaded long
before the test is opened - and is listed as "Loaded" in the addin dialog. A
user might wonder why the addin is Loaded when there was no LoadAddin
specified..
 
I don't understand why you would allow this to be optional, and in turn
allow [MyTest] to silently do nothing if the addin was not properly
installed. 
 
To be clear, I would not make it optional in my own work or for my own
teams. I'm just a little uncomfortable as a tool-builder making rules of
practice that others have to follow. I'm still hoping that others besides
you and me will chime in on this discusison though. :-)
 
Charlie

On Wed, Jul 16, 2008 at 7:34 PM, Charlie Poole <[email protected]>
wrote:



Is it possible for an assembly to run with Attributes which reference
unresolved assemblies?

I would think that the mere appearance of [MyTest] would mean that plugin
assembly would have to be present to run the code. 


I see what you're saying. If [MyTest] compiled, the addin must have been
available. However...
 
1. Tests are sometimes compiled in one place, then execcuted elsewhere.
2. Having an assembly available to be referenced does not necessarily mean
that it's
properly installed as an addin - although NUnit /could/ try to find and use
it in that case.
3. Most important, the canonical implementation of an addin does /not/ put
the definition
of any special attributes in the same assembly as the addin itself because
of reference
problems that arise. This could change in 3.0, but is still the recommended
pattern
for 2.5.
 
So, for all those reasons, it is indeed possible ot have an attribute for
which the
addin is not available. In the case of [MyTest], the test will simply not be
seen and
whether anyone notices is an open question.

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