Assert.AreAllOfType メソッド

定義

オーバーロード

名前 説明
AreAllOfType(Type, IEnumerable, String, String, String)

指定したコレクション内のすべての要素が予期される型のインスタンス (または派生) であるかどうかをテストし、予期される型が 1 つ以上の要素の継承階層にない場合、または要素が null の場合に例外をスローします。

AreAllOfType<TExpected>(IEnumerable, String, String)

指定したコレクション内のすべての要素が予期される型のインスタンス (または派生) であるかどうかをテストし、予期される型が 1 つ以上の要素の継承階層にない場合、または要素が null の場合に例外をスローします。

AreAllOfType(Type, IEnumerable, String, String, String)

ソース:
Assert.AreAllOfType.cs

指定したコレクション内のすべての要素が予期される型のインスタンス (または派生) であるかどうかをテストし、予期される型が 1 つ以上の要素の継承階層にない場合、または要素が null の場合に例外をスローします。

public static void AreAllOfType(Type? expectedType, System.Collections.IEnumerable? collection, string? message = "", string expectedTypeExpression = "", string collectionExpression = "");
static member AreAllOfType : Type * System.Collections.IEnumerable * string * string * string -> unit
Public Shared Sub AreAllOfType (expectedType As Type, collection As IEnumerable, Optional message As String = "", Optional expectedTypeExpression As String = "", Optional collectionExpression As String = "")

パラメーター

expectedType
Type

collectionの各要素の予期される型。

collection
IEnumerable

テストで想定される要素を含むコレクションは、指定した型です。

message
String

collection内の要素が null であるか、expectedTypeのインスタンスでない場合に例外に含めるメッセージ。 メッセージがテスト結果に表示されます。

expectedTypeExpression
String

呼び出し元の引数式を使用してコンパイラによって指定された expectedType の構文式。 ユーザーは、このパラメーターの値を渡さないでください。

collectionExpression
String

呼び出し元の引数式を介してコンパイラによって指定されたコレクションの構文式。 ユーザーは、このパラメーターの値を渡さないでください。

例外

expectedTypeまたはcollectionが null の場合、またはcollectionの一部の要素が null であるか、expectedTypeから継承または実装されていない場合にスローされます。

適用対象

AreAllOfType<TExpected>(IEnumerable, String, String)

ソース:
Assert.AreAllOfType.cs

指定したコレクション内のすべての要素が予期される型のインスタンス (または派生) であるかどうかをテストし、予期される型が 1 つ以上の要素の継承階層にない場合、または要素が null の場合に例外をスローします。

public static void AreAllOfType<TExpected>(System.Collections.IEnumerable? collection, string? message = "", string collectionExpression = "");
static member AreAllOfType : System.Collections.IEnumerable * string * string -> unit
Public Shared Sub AreAllOfType(Of TExpected) (collection As IEnumerable, Optional message As String = "", Optional collectionExpression As String = "")

型パラメーター

TExpected

collectionの各要素の型は次のように想定されます。

パラメーター

collection
IEnumerable

テストで想定される要素を含むコレクションは、指定した型です。

message
String

collection内の要素が null であるか、TExpectedのインスタンスでない場合に例外に含めるメッセージ。 メッセージがテスト結果に表示されます。

collectionExpression
String

呼び出し元の引数式を介してコンパイラによって指定されたコレクションの構文式。 ユーザーは、このパラメーターの値を渡さないでください。

例外

collectionが null であるか、collectionの一部の要素が null であるか、TExpectedから継承または実装されていない場合にスローされます。

適用対象