347
351
return this.FullName.CompareTo( other.FullName );
356
/// Modify a newly constructed test by applying any of NUnit's common
357
/// attributes, based on an input array of attributes. This method checks
358
/// for all attributes, relying on the fact that specific attributes can only
359
/// occur on those constructs on which they are allowed.
361
/// <param name="attributes">An array of attributes possibly including NUnit attributes</param>
362
public void ApplyCommonAttributes(Attribute[] attributes)
364
foreach (Attribute attribute in attributes)
366
Type attributeType = attribute.GetType();
367
string attributeName = attributeType.FullName;
368
bool isValid = this.RunState != RunState.NotRunnable;
370
if (attribute is TestFixtureAttribute)
372
if (this.Description == null)
373
this.Description = ((TestFixtureAttribute)attribute).Description;
375
else if (attribute is TestAttribute)
377
if (this.Description == null)
378
this.Description = ((TestAttribute)attribute).Description;
380
else if (attribute is ISetRunState)
384
ISetRunState irs = (ISetRunState)attribute;
385
this.RunState = irs.GetRunState();
386
this.IgnoreReason = irs.GetReason();
389
else if (attribute is CategoryAttribute)
391
this.Categories.Add(((CategoryAttribute)attribute).Name);
393
else if (attribute is PropertyAttribute)
395
IDictionary props = ((PropertyAttribute)attribute).Properties;
397
foreach (DictionaryEntry entry in props)
398
this.Properties.Add(entry.Key, entry.Value);