Daily Usage Issues

Assembly level attributes

Started by CourtJesterBob on 5,383 views

I see in the documentation that I can use the ExclusivelyUses attribute at the assembly level, but I don't see anywhere that shows exactly how to do this. I know I can decorate a test or test fixture with this, but if I have many text fixtures in my project with multiple tests in each fixture and I am not sure where to put the ExclusivelyUses attribute so it applies assembly wide.

Bob
Hi Bob -

You'd use this the same way as other attributes that are specified in AssemblyInfo.cs, for example:

[assembly: NCrunch.Framework.ExclusivelyUses("ResourceName")]

.. This can be applied in any .cs file, but I'd recommend AssemblyInfo.cs as this is more conventional in C#.


Cheers,

Remco

Post a reply

Log in to reply.