Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GenericParameterHelper Class
Collapse the table of content
Expand the table of content

GenericParameterHelper Class

This class is a placeholder for use with generics. It helps you test generic types by letting you pass non-specific type arguments.


Namespace:  Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

public class GenericParameterHelper : IComparable, 
	IEnumerable, ICloneable

The GenericParameterHelper type exposes the following members.

Public methodGenericParameterHelper()Initializes a new instance of the GenericParameterHelper class. This constructor initializes the Data property to a random value.
Public methodGenericParameterHelper(Int32)Initializes a new instance of the GenericParameterHelper class. This constructor initializes the Data property to a user specified value.

Public propertyDataGets or sets the Data property for this instance.

Public methodCloneCreates a new GenericParameterHelper that is a copy of the current instance.
Public methodCompareToCompares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Public methodEqualsDetermines whether the specified GenericParameterHelper object is equal to the current GenericParameterHelper object. (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns an enumerator whose length is derived from the Data property.
Public methodGetHashCodeReturns the hash code for this GenericParameterHelper object. (Overrides Object.GetHashCode.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

A unit test might not be able to pass a real type to a generic method that it is testing. That code can pass this generic placeholder instead.

When the Team System testing tools generates a unit test for testing a generic type, the calls that test that generic type use placeholder generic type arguments.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft