共用方式為


CollectionAssert.IsSubsetOf Method

Definition

Overloads

IsSubsetOf(ICollection, ICollection, String)

Tests whether one collection is a subset of another collection and throws an exception if any element in the subset is not also in the superset.

IsSubsetOf(ICollection, ICollection, String, Object[])

Tests whether one collection is a subset of another collection and throws an exception if any element in the subset is not also in the superset.

IsSubsetOf(ICollection, ICollection)

Tests whether one collection is a subset of another collection and throws an exception if any element in the subset is not also in the superset.

IsSubsetOf(ICollection, ICollection, String)

Tests whether one collection is a subset of another collection and throws an exception if any element in the subset is not also in the superset.

public:
 static void IsSubsetOf(System::Collections::ICollection ^ subset, System::Collections::ICollection ^ superset, System::String ^ message);
public static void IsSubsetOf (System.Collections.ICollection subset, System.Collections.ICollection superset, string message);
static member IsSubsetOf : System.Collections.ICollection * System.Collections.ICollection * string -> unit
Public Shared Sub IsSubsetOf (subset As ICollection, superset As ICollection, message As String)

Parameters

subset
ICollection

The collection expected to be a subset of superset.

superset
ICollection

The collection expected to be a superset of subset

message
String

The message to include in the exception when an element in subset is not found in superset. The message is shown in test results.

Exceptions

Thrown if an element in subset is not found in superset.

Applies to

IsSubsetOf(ICollection, ICollection, String, Object[])

Tests whether one collection is a subset of another collection and throws an exception if any element in the subset is not also in the superset.

public:
 static void IsSubsetOf(System::Collections::ICollection ^ subset, System::Collections::ICollection ^ superset, System::String ^ message, ... cli::array <System::Object ^> ^ parameters);
public static void IsSubsetOf (System.Collections.ICollection subset, System.Collections.ICollection superset, string message, params object[] parameters);
static member IsSubsetOf : System.Collections.ICollection * System.Collections.ICollection * string * obj[] -> unit
Public Shared Sub IsSubsetOf (subset As ICollection, superset As ICollection, message As String, ParamArray parameters As Object())

Parameters

subset
ICollection

The collection expected to be a subset of superset.

superset
ICollection

The collection expected to be a superset of subset

message
String

The message to include in the exception when an element in subset is not found in superset. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if an element in subset is not found in superset.

Applies to

IsSubsetOf(ICollection, ICollection)

Tests whether one collection is a subset of another collection and throws an exception if any element in the subset is not also in the superset.

public:
 static void IsSubsetOf(System::Collections::ICollection ^ subset, System::Collections::ICollection ^ superset);
public static void IsSubsetOf (System.Collections.ICollection subset, System.Collections.ICollection superset);
static member IsSubsetOf : System.Collections.ICollection * System.Collections.ICollection -> unit
Public Shared Sub IsSubsetOf (subset As ICollection, superset As ICollection)

Parameters

subset
ICollection

The collection expected to be a subset of superset.

superset
ICollection

The collection expected to be a superset of subset

Exceptions

Thrown if an element in subset is not found in superset.

Applies to