예제 #1
0
 /// <summary>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.</summary>
 /// <param name="collection">The collection to verify.</param>
 /// <param name="expectedType">The type expected to be found in the inheritance hierarchy of every element in <paramref name="collection" />.</param>
 /// <param name="message">A message to display if the assertion fails. This message can be seen in the unit test results.</param>
 /// <param name="parameters">An array of parameters to use when formatting <paramref name="message" />.</param>
 /// <exception cref="AssertFailedException">An element in <paramref name="collection" /> is null or <paramref name="expectedType" /> is not found in the inheritance hierarchy of all elements in <paramref name="collection" />.</exception>
 public virtual void AllItemsAreInstancesOfType(ICollection collection, Type expectedType, string message, params object[] parameters) => CollectionAssert.AllItemsAreInstancesOfType(collection, expectedType, message, parameters);
예제 #2
0
 /// <summary>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.</summary>
 /// <param name="collection">The collection to verify.</param>
 /// <param name="expectedType">The type expected to be found in the inheritance hierarchy of every element in <paramref name="collection" />.</param>
 /// <param name="message">A message to display if the assertion fails. This message can be seen in the unit test results.</param>
 /// <exception cref="AssertFailedException">An element in <paramref name="collection" /> is null or <paramref name="expectedType" /> is not found in the inheritance hierarchy of all elements in <paramref name="collection" />.</exception>
 public virtual void AllItemsAreInstancesOfType(ICollection collection, Type expectedType, string message) => CollectionAssert.AllItemsAreInstancesOfType(collection, expectedType, message, null);