CollectionAssert.IsSubsetOf Method (ICollection, ICollection)
Verifies that the first collection is a subset of the second collection.
Namespace: Microsoft.VisualStudio.TestTools.UnitTesting
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
Syntax
'Declaration
Public Shared Sub IsSubsetOf ( _
subset As ICollection, _
superset As ICollection _
)
public static void IsSubsetOf(
ICollection subset,
ICollection superset
)
public:
static void IsSubsetOf(
ICollection^ subset,
ICollection^ superset
)
static member IsSubsetOf :
subset:ICollection *
superset:ICollection -> unit
public static function IsSubsetOf(
subset : ICollection,
superset : ICollection
)
Parameters
subset
Type: ICollectionThe collection expected to be a subset of superset.
superset
Type: ICollectionThe collection expected to be a superset of subset.
Exceptions
Exception | Condition |
---|---|
AssertFailedException | An element in subset is not found in superset or an element in subset is not found in superset in sufficient quantity. |
Remarks
One collection is a subset of another collection if every element in the first collection also appears in the second collection. An element that appears in the first collection more than once must appear in the second collection as many times, or more, as it does in the first collection. The second collection may have elements that are not in the first collection, but that is not required.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualStudio.TestTools.UnitTesting Namespace