Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AllItemsAreInstancesOfType Method (ICollection, Type)

CollectionAssert.AllItemsAreInstancesOfType Method (ICollection, Type)

Verifies that all elements in the specified collection are instances of the specified type. The assertion fails if for any element the type is not found in its inheritance hierarchy.

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

public static void AllItemsAreInstancesOfType(
	ICollection collection,
	Type expectedType
)

Parameters

collection
Type: System.Collections.ICollection
The collection to verify.
expectedType
Type: System.Type
The type expected to be found in the inheritance hierarchy of every element in collection.

ExceptionCondition
AssertFailedException

An element in collection is null or expectedType is not found in the inheritance hierarchy of all elements in collection.

Community Additions

ADD
Show:
© 2015 Microsoft