Condividi tramite


CollectionAssert.AllItemsAreInstancesOfType Method

Include Protected Members
Include Inherited Members

Verifies that all elements in a specified collection are instances of a specified type.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public methodStatic member AllItemsAreInstancesOfType(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.
Public methodStatic member AllItemsAreInstancesOfType(ICollection, Type, String) Verifies that all elements in the specified collection are instances of the specified type. The assertion fails if there exists one element in the collection for which the specified type is not found in its inheritance hierarchy. Displays a message if the assertion fails.
Public methodStatic member AllItemsAreInstancesOfType(ICollection, Type, String, array<Object[]) Verifies that all elements in the specified collection are instances of the specified type. The assertion fails if there exists one element in the collection for which the specified type is not found in its inheritance hierarchy. Displays a message if the assertion fails, and applies the specified formatting to it.

Top

See Also

Reference

CollectionAssert Class

Microsoft.VisualStudio.TestTools.UnitTesting Namespace