1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using ICSharpCode.SharpDevelop.Dom;
7
namespace ICSharpCode.UnitTesting
9
public class NUnitTestAttributeName
11
string name = String.Empty;
12
string qualifiedName = String.Empty;
13
string fullyQualifiedName = String.Empty;
14
StringComparer nameComparer;
17
/// Creates a new instance of the NUnit Test Attribute class.
19
/// <param name="name">The name of the attribute (e.g. Test) not
20
/// the full name of the attribute (e.g. TestAttribute).</param>
21
/// <param name="nameComparer">The string comparer to use
22
/// when comparing attribute names.</param>
23
public NUnitTestAttributeName(string name, StringComparer nameComparer)
26
this.nameComparer = nameComparer;
27
qualifiedName = String.Concat(name, "Attribute");
28
fullyQualifiedName = String.Concat("NUnit.Framework.", name, "Attribute");
32
/// Determines whether the specified attribute name is a
33
/// match to this attribute.
35
public bool IsEqual(string attributeName)
37
if (nameComparer.Equals(attributeName, name) ||
38
nameComparer.Equals(attributeName, qualifiedName) ||
39
nameComparer.Equals(attributeName, fullyQualifiedName)) {
45
public bool IsEqual(IAttribute attribute)
47
return IsEqual(attribute.AttributeType.FullyQualifiedName);