Class TypeMatcherAttribute
- Namespace
- Moq
- Assembly
- Moq.dll
Marks a type as a type matcher, optionally specifying another ITypeMatcher type that will perform the matching.
Type matchers preferably implement ITypeMatcher themselves. Use the parameterized form of this attribute where this is not possible, such as when the type matcher needs to be a delegate or enum type in order to satisfy generic type constraints of the method where it is used.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Interface|AttributeTargets.Delegate, AllowMultiple = false, Inherited = true)]
public class TypeMatcherAttribute : Attribute
- Inheritance
-
TypeMatcherAttribute
- Inherited Members
Constructors
TypeMatcherAttribute()
Initializes a new instance of the TypeMatcherAttribute class.
Use this constructor overload if the type on which this attribute is placed implements ITypeMatcher itself.
public TypeMatcherAttribute()
TypeMatcherAttribute(Type)
Initializes a new instance of the TypeMatcherAttribute class.
Use this constructor overload if the type on which this attribute is placed does not implement ITypeMatcher. The specified type will instead provide the implementation of ITypeMatcher.
public TypeMatcherAttribute(Type type)
Parameters
typeTypeThe Moq.TypeMatcherAttribute.Type of a type that implements ITypeMatcher.