source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/IHS BMX Framework/lib/NUnit/NUnit-2.5.10.11092/doc/collectionAssert.html@ 1146

Last change on this file since 1146 was 1146, checked in by Sam Habiel, 13 years ago

Initial Import of BMX4

File size: 7.4 KB
Line 
1<!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2<html>
3<!-- Standard Head Part -->
4<head>
5<title>NUnit - CollectionAssert</title>
6<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
7<meta http-equiv="Content-Language" content="en-US">
8<link rel="stylesheet" type="text/css" href="nunit.css">
9<link rel="shortcut icon" href="favicon.ico">
10</head>
11<!-- End Standard Head Part -->
12
13<body>
14
15<!-- Standard Header for NUnit.org -->
16<div id="header">
17 <a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
18 <div id="nav">
19 <a href="http://www.nunit.org">NUnit</a>
20 <a class="active" href="index.html">Documentation</a>
21 </div>
22</div>
23<!-- End of Header -->
24
25<div id="content">
26
27<h2>CollectionAssert (NUnit 2.4 / 2.5)</h2>
28<p>The CollectionAssert class provides a number of methods that are useful
29when examining collections and their contents or for comparing two collections.</p>
30
31<p>The <b>AreEqual</b> overloads succeed if the corresponding elements of the two
32collections are equal. <b>AreEquivalent</b> tests whether the collection contents
33are equal, but without regard to order. In both cases, elements are compared using
34NUnit's default equality comparison.</p>
35
36<p>Beginning with NUnit 2.4.6, these methods may be used on any object that
37implements IEnumerable. Prior to 2.4.6, only true collections were supported.
38
39<div class="code" style="width: 38em">
40<pre>CollectionAssert.AllItemsAreInstancesOfType( IEnumerable collection,
41 Type expectedType );
42CollectionAssert.AllItemsAreInstancesOfType( IEnumerable collection,
43 Type expectedType, string message );
44CollectionAssert.AllItemsAreInstancesOfType( IEnumerable collection,
45 Type expectedType, string message, params object[] args );
46
47CollectionAssert.AllItemsAreNotNull( IEnumerable collection );
48CollectionAssert.AllItemsAreNotNull( IEnumerable collection,
49 string message );
50CollectionAssert.AllItemsAreNotNull( IEnumerable collection,
51 string message, params object[] args );
52
53CollectionAssert.AllItemsAreUnique( IEnumerable collection );
54CollectionAssert.AllItemsAreUnique( IEnumerable collection,
55 string message );
56CollectionAssert.AllItemsAreUnique( IEnumerable collection,
57 string message, params object[] args );
58
59CollectionAssert.AreEqual( IEnumerable expected, IEnumerable actual );
60CollectionAssert.AreEqual( IEnumerable expected, IEnumerable actual,
61 string message );
62CollectionAssert.AreEqual( IEnumerable expected, IEnumerable actual
63 string message, params object[] args );
64
65CollectionAssert.AreEquivalent( IEnumerable expected, IEnumerable actual);
66CollectionAssert.AreEquivalent( IEnumerable expected, IEnumerable actual,
67 string message );
68CollectionAssert.AreEquivalent( IEnumerable expected, IEnumerable actual
69 string message, params object[] args );
70
71CollectionAssert.AreNotEqual( IEnumerable expected, IEnumerable actual );
72CollectionAssert.AreNotEqual( IEnumerable expected, IEnumerable actual,
73 string message );
74CollectionAssert.AreNotEqual( IEnumerableon expected, IEnumerable actual
75 string message, params object[] args );
76
77CollectionAssert.AreNotEquivalent( IEnumerable expected,
78 IEnumerable actual );
79CollectionAssert.AreNotEquivalent( IEnumerable expected,
80 IEnumerable actual, string message );
81CollectionAssert.AreNotEquivalent( IEnumerable expected,
82 IEnumerable actual, string message, params object[] args );
83
84CollectionAssert.Contains( IEnumerable expected, object actual );
85CollectionAssert.Contains( IEnumerable expected, object actual,
86 string message );
87CollectionAssert.Contains( IEnumerable expected, object actual
88 string message, params object[] args );
89
90CollectionAssert.DoesNotContain( IEnumerable expected, object actual );
91CollectionAssert.DoesNotContain( IEnumerable expected, object actual,
92 string message );
93CollectionAssert.DoesNotContain( IEnumerable expected, object actual
94 string message, params object[] args );
95
96CollectionAssert.IsSubsetOf( IEnumerable subset, IEnumerable superset );
97CollectionAssert.IsSubsetOf( IEnumerable subset, IEnumerable superset,
98 string message );
99CollectionAssert.IsSubsetOf( IEnumerable subset, IEnumerable superset,
100 string message, params object[] args );
101
102CollectionAssert.IsNotSubsetOf( IEnumerable subset, IEnumerable superset);
103CollectionAssert.IsNotSubsetOf( IEnumerable subset, IEnumerable superset,
104 string message );
105CollectionAssert.IsNotSubsetOf( IEnumerable subset, IEnumerable superset,
106 string message, params object[] args );
107
108CollectionAssert.IsEmpty( IEnumerable collection );
109CollectionAssert.IsEmpty( IEnumerable collection, string message );
110CollectionAssert.IsEmpty( IEnumerable collection, string message,
111 params object[] args );
112
113CollectionAssert.IsNotEmpty( IEnumerable collection );
114CollectionAssert.IsNotEmpty( IEnumerable collection, string message );
115CollectionAssert.IsNotEmpty( IEnumerable collection, string message,
116 params object[] args );
117</pre></div>
118
119<p>The following methods are available beginning with NUnit 2.5
120
121<div class="code" style="width: 38em"><pre>
122CollectionAssert.IsOrdered( IEnumerable collection );
123CollectionAssert.IsOrdered( IEnumerable collection, string message );
124CollectionAssert.IsOrdered( IEnumerable collection, string message,
125 params object[] args );
126
127CollectionAssert.IsOrdered( IEnumerable collection, IComparer comparer );
128CollectionAssert.IsOrdered( IEnumerable collection, IComparer comparer,
129 string message );
130CollectionAssert.IsOrdered( IEnumerable collection, IComparer comparer,
131 string message, params object[] args );
132</pre></div>
133
134</div>
135
136<!-- Submenu -->
137<div id="subnav">
138<ul>
139<li><a href="index.html">NUnit 2.5.10</a></li>
140<ul>
141<li><a href="getStarted.html">Getting&nbsp;Started</a></li>
142<li><a href="assertions.html">Assertions</a></li>
143<ul>
144<li><a href="equalityAsserts.html">Equality&nbsp;Asserts</a></li>
145<li><a href="identityAsserts.html">Identity&nbsp;Asserts</a></li>
146<li><a href="conditionAsserts.html">Condition&nbsp;Asserts</a></li>
147<li><a href="comparisonAsserts.html">Comparison&nbsp;Asserts</a></li>
148<li><a href="typeAsserts.html">Type&nbsp;Asserts</a></li>
149<li><a href="exceptionAsserts.html">Exception&nbsp;Asserts</a></li>
150<li><a href="utilityAsserts.html">Utility&nbsp;Methods</a></li>
151<li><a href="stringAssert.html">String&nbsp;Assert</a></li>
152<li id="current"><a href="collectionAssert.html">Collection&nbsp;Assert</a></li>
153<li><a href="fileAssert.html">File&nbsp;Assert</a></li>
154<li><a href="directoryAssert.html">Directory&nbsp;Assert</a></li>
155</ul>
156<li><a href="constraintModel.html">Constraints</a></li>
157<li><a href="attributes.html">Attributes</a></li>
158<li><a href="runningTests.html">Running&nbsp;Tests</a></li>
159<li><a href="extensibility.html">Extensibility</a></li>
160<li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
161<li><a href="samples.html">Samples</a></li>
162<li><a href="license.html">License</a></li>
163</ul>
164</ul>
165</div>
166<!-- End of Submenu -->
167
168
169<!-- Standard Footer for NUnit.org -->
170<div id="footer">
171 Copyright &copy; 2010 Charlie Poole. All Rights Reserved.
172</div>
173<!-- End of Footer -->
174
175</body>
176</html>
Note: See TracBrowser for help on using the repository browser.