nunit 2.4.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/docs/addinsDialog.html +74 -0
- data/docs/assertions.html +91 -0
- data/docs/attributes.html +89 -0
- data/docs/category.html +265 -0
- data/docs/classicModel.html +92 -0
- data/docs/codeFuncs.js +77 -0
- data/docs/collectionAssert.html +162 -0
- data/docs/collectionConstraints.html +130 -0
- data/docs/comparisonAsserts.html +271 -0
- data/docs/comparisonConstraints.html +109 -0
- data/docs/compoundConstraints.html +97 -0
- data/docs/conditionAsserts.html +123 -0
- data/docs/conditionConstraints.html +106 -0
- data/docs/configEditor.html +93 -0
- data/docs/configFiles.html +155 -0
- data/docs/consoleCommandLine.html +271 -0
- data/docs/constraintModel.html +134 -0
- data/docs/contextMenu.html +106 -0
- data/docs/culture.html +255 -0
- data/docs/customAsserts.html +115 -0
- data/docs/customConstraints.html +101 -0
- data/docs/description.html +178 -0
- data/docs/equalConstraint.html +139 -0
- data/docs/equalityAsserts.html +187 -0
- data/docs/exception.html +296 -0
- data/docs/explicit.html +256 -0
- data/docs/extensibility.html +83 -0
- data/docs/favicon.ico +0 -0
- data/docs/features.html +75 -0
- data/docs/fileAssert.html +114 -0
- data/docs/files/QuickStart.Spanish.doc +0 -0
- data/docs/files/QuickStart.doc +0 -0
- data/docs/files/Results.xsd +70 -0
- data/docs/files/Summary.xslt +47 -0
- data/docs/files/TestResult.xml +103 -0
- data/docs/files/Thumbs.db +0 -0
- data/docs/fixtureSetup.html +201 -0
- data/docs/fixtureTeardown.html +204 -0
- data/docs/getStarted.html +80 -0
- data/docs/guiCommandLine.html +183 -0
- data/docs/identityAsserts.html +99 -0
- data/docs/ignore.html +249 -0
- data/docs/img/addinsDialog.JPG +0 -0
- data/docs/img/assembliesTab.jpg +0 -0
- data/docs/img/assemblyReloadOptions.JPG +0 -0
- data/docs/img/bulletOff.gif +0 -0
- data/docs/img/bulletOn.gif +0 -0
- data/docs/img/configEditor.jpg +0 -0
- data/docs/img/console-mock.jpg +0 -0
- data/docs/img/displayTab.jpg +0 -0
- data/docs/img/generalOptions.jpg +0 -0
- data/docs/img/generalTab.jpg +0 -0
- data/docs/img/gui-screenshot.jpg +0 -0
- data/docs/img/gui-verify.jpg +0 -0
- data/docs/img/langFilter.gif +0 -0
- data/docs/img/logo.gif +0 -0
- data/docs/img/miniGui.jpg +0 -0
- data/docs/img/optionsDialog.jpg +0 -0
- data/docs/img/resultTab.jpg +0 -0
- data/docs/img/testLoadOptions.jpg +0 -0
- data/docs/img/testOutputOptions.jpg +0 -0
- data/docs/img/testProperties.jpg +0 -0
- data/docs/img/testResultOptions.JPG +0 -0
- data/docs/img/testTab.jpg +0 -0
- data/docs/img/testsTab.JPG +0 -0
- data/docs/img/textOutputOptions.jpg +0 -0
- data/docs/img/treeDisplayOptions.JPG +0 -0
- data/docs/img/visualStudioOptions.JPG +0 -0
- data/docs/index.html +75 -0
- data/docs/installation.html +172 -0
- data/docs/license.html +88 -0
- data/docs/listMapper.html +100 -0
- data/docs/mainMenu.html +260 -0
- data/docs/multiAssembly.html +130 -0
- data/docs/nunit-console.html +84 -0
- data/docs/nunit-gui.html +115 -0
- data/docs/nunit.css +118 -0
- data/docs/nunitAddins.html +331 -0
- data/docs/optionsDialog.html +262 -0
- data/docs/platform.html +285 -0
- data/docs/platformSupport.html +99 -0
- data/docs/projectEditor.html +127 -0
- data/docs/property.html +219 -0
- data/docs/propertyConstraint.html +89 -0
- data/docs/quickStart.html +314 -0
- data/docs/releaseNotes.html +1235 -0
- data/docs/sameasConstraint.html +98 -0
- data/docs/samples.html +126 -0
- data/docs/setCulture.html +173 -0
- data/docs/setup.html +199 -0
- data/docs/setupFixture.html +198 -0
- data/docs/stringAssert.html +107 -0
- data/docs/stringConstraints.html +111 -0
- data/docs/suite.html +222 -0
- data/docs/teardown.html +204 -0
- data/docs/test.html +171 -0
- data/docs/testFixture.html +168 -0
- data/docs/testProperties.html +76 -0
- data/docs/typeAsserts.html +101 -0
- data/docs/typeConstraints.html +103 -0
- data/docs/upgrade.html +97 -0
- data/docs/utilityAsserts.html +108 -0
- data/docs/vsSupport.html +140 -0
- data/lib/net-1.1/Failure.jpg +0 -0
- data/lib/net-1.1/Ignored.jpg +0 -0
- data/lib/net-1.1/NUnitFitTests.html +277 -0
- data/lib/net-1.1/NUnitTests.config +84 -0
- data/lib/net-1.1/NUnitTests.nunit +14 -0
- data/lib/net-1.1/Success.jpg +0 -0
- data/lib/net-1.1/clr.bat +96 -0
- data/lib/net-1.1/fit.dll +0 -0
- data/lib/net-1.1/loadtest-assembly.dll +0 -0
- data/lib/net-1.1/mock-assembly.dll +0 -0
- data/lib/net-1.1/nonamespace-assembly.dll +0 -0
- data/lib/net-1.1/notestfixtures-assembly.dll +0 -0
- data/lib/net-1.1/nunit-console-runner.dll +0 -0
- data/lib/net-1.1/nunit-console.exe +0 -0
- data/lib/net-1.1/nunit-console.exe.config +117 -0
- data/lib/net-1.1/nunit-console.tests.dll +0 -0
- data/lib/net-1.1/nunit-gui-runner.dll +0 -0
- data/lib/net-1.1/nunit-gui.tests.dll +0 -0
- data/lib/net-1.1/nunit.core.dll +0 -0
- data/lib/net-1.1/nunit.core.extensions.dll +0 -0
- data/lib/net-1.1/nunit.core.interfaces.dll +0 -0
- data/lib/net-1.1/nunit.core.tests.dll +0 -0
- data/lib/net-1.1/nunit.exe +0 -0
- data/lib/net-1.1/nunit.exe.config +121 -0
- data/lib/net-1.1/nunit.extensions.tests.dll +0 -0
- data/lib/net-1.1/nunit.fixtures.dll +0 -0
- data/lib/net-1.1/nunit.fixtures.tests.dll +0 -0
- data/lib/net-1.1/nunit.framework.dll +0 -0
- data/lib/net-1.1/nunit.framework.extensions.dll +0 -0
- data/lib/net-1.1/nunit.framework.tests.dll +0 -0
- data/lib/net-1.1/nunit.framework.xml +5622 -0
- data/lib/net-1.1/nunit.mocks.dll +0 -0
- data/lib/net-1.1/nunit.mocks.tests.dll +0 -0
- data/lib/net-1.1/nunit.uikit.dll +0 -0
- data/lib/net-1.1/nunit.uikit.tests.dll +0 -0
- data/lib/net-1.1/nunit.util.dll +0 -0
- data/lib/net-1.1/nunit.util.tests.dll +0 -0
- data/lib/net-1.1/runFile.exe +0 -0
- data/lib/net-1.1/runFile.exe.config +43 -0
- data/lib/net-1.1/test-assembly.dll +0 -0
- data/lib/net-1.1/test-utilities.dll +0 -0
- data/lib/net-1.1/timing-tests.dll +0 -0
- data/lib/net-2.0/Failure.jpg +0 -0
- data/lib/net-2.0/Ignored.jpg +0 -0
- data/lib/net-2.0/NUnitFitTests.html +277 -0
- data/lib/net-2.0/NUnitTests.config +84 -0
- data/lib/net-2.0/NUnitTests.nunit +14 -0
- data/lib/net-2.0/Success.jpg +0 -0
- data/lib/net-2.0/clr.bat +96 -0
- data/lib/net-2.0/fit.dll +0 -0
- data/lib/net-2.0/loadtest-assembly.dll +0 -0
- data/lib/net-2.0/mock-assembly.dll +0 -0
- data/lib/net-2.0/nonamespace-assembly.dll +0 -0
- data/lib/net-2.0/notestfixtures-assembly.dll +0 -0
- data/lib/net-2.0/nunit-console-runner.dll +0 -0
- data/lib/net-2.0/nunit-console-x86.exe +0 -0
- data/lib/net-2.0/nunit-console-x86.exe.config +117 -0
- data/lib/net-2.0/nunit-console.exe +0 -0
- data/lib/net-2.0/nunit-console.exe.config +117 -0
- data/lib/net-2.0/nunit-console.tests.dll +0 -0
- data/lib/net-2.0/nunit-gui-runner.dll +0 -0
- data/lib/net-2.0/nunit-gui.tests.dll +0 -0
- data/lib/net-2.0/nunit-x86.exe +0 -0
- data/lib/net-2.0/nunit-x86.exe.config +121 -0
- data/lib/net-2.0/nunit.core.dll +0 -0
- data/lib/net-2.0/nunit.core.extensions.dll +0 -0
- data/lib/net-2.0/nunit.core.interfaces.dll +0 -0
- data/lib/net-2.0/nunit.core.tests.dll +0 -0
- data/lib/net-2.0/nunit.exe +0 -0
- data/lib/net-2.0/nunit.exe.config +121 -0
- data/lib/net-2.0/nunit.extensions.tests.dll +0 -0
- data/lib/net-2.0/nunit.fixtures.dll +0 -0
- data/lib/net-2.0/nunit.fixtures.tests.dll +0 -0
- data/lib/net-2.0/nunit.framework.dll +0 -0
- data/lib/net-2.0/nunit.framework.extensions.dll +0 -0
- data/lib/net-2.0/nunit.framework.tests.dll +0 -0
- data/lib/net-2.0/nunit.framework.xml +5622 -0
- data/lib/net-2.0/nunit.mocks.dll +0 -0
- data/lib/net-2.0/nunit.mocks.tests.dll +0 -0
- data/lib/net-2.0/nunit.uikit.dll +0 -0
- data/lib/net-2.0/nunit.uikit.tests.dll +0 -0
- data/lib/net-2.0/nunit.util.dll +0 -0
- data/lib/net-2.0/nunit.util.tests.dll +0 -0
- data/lib/net-2.0/runFile.exe +0 -0
- data/lib/net-2.0/runFile.exe.config +43 -0
- data/lib/net-2.0/test-assembly.dll +0 -0
- data/lib/net-2.0/test-utilities.dll +0 -0
- data/lib/net-2.0/timing-tests.dll +0 -0
- metadata +262 -0
@@ -0,0 +1,92 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
2
|
+
<html>
|
3
|
+
<!-- Standard Head Part -->
|
4
|
+
<head>
|
5
|
+
<title>NUnit - ClassicModel</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>Classic Assert Model</h2>
|
28
|
+
|
29
|
+
<p>The classic Assert model uses a separate method to express each
|
30
|
+
individual assertion of which it is capable.
|
31
|
+
|
32
|
+
<p>Here's a simple assert using the classic model:
|
33
|
+
<pre> StringAssert.AreEqualIgnoringCase( "Hello", myString );</pre>
|
34
|
+
|
35
|
+
<p>The Assert class provides the most commonly used assertions.
|
36
|
+
For convenience of presentation, we group Assert methods as follows:
|
37
|
+
<ul>
|
38
|
+
<li><a href="equalityAsserts.html">Equality Asserts</a> <li><a href="identityAsserts.html">Identity Asserts</a> <li><a href="comparisonAsserts.html">Comparison Asserts</a> <li><a href="typeAsserts.html">Type Asserts</a> <li><a href="conditionAsserts.html">Condition tests</a> <li><a href="utilityAsserts.html">Utility methods</a></ul></p>
|
39
|
+
|
40
|
+
<p>Beyond the basic facilities of Assert, additional assertions are provided by
|
41
|
+
the following classes:
|
42
|
+
<ul>
|
43
|
+
<li><a href="stringAssert.html">StringAssert</a> <li><a href="collectionAssert.html">CollectionAssert</a> <li><a href="fileAssert.html">FileAssert</a></ul></p>
|
44
|
+
|
45
|
+
<p><b>See also:</b> the
|
46
|
+
<a href="constraintModel.html">constraint-based model</a> of assertions.
|
47
|
+
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<!-- Submenu -->
|
51
|
+
<div id="subnav">
|
52
|
+
<ul>
|
53
|
+
<li><a href="index.html">NUnit 2.4.8</a></li>
|
54
|
+
<ul>
|
55
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
56
|
+
<li><a href="assertions.html">Assertions</a></li>
|
57
|
+
<ul>
|
58
|
+
<li id="current"><a href="classicModel.html">Classic Model</a></li>
|
59
|
+
<ul>
|
60
|
+
<li><a href="equalityAsserts.html">Equality Asserts</a></li>
|
61
|
+
<li><a href="identityAsserts.html">Identity Asserts</a></li>
|
62
|
+
<li><a href="conditionAsserts.html">Condition Tests</a></li>
|
63
|
+
<li><a href="comparisonAsserts.html">Comparison Asserts</a></li>
|
64
|
+
<li><a href="typeAsserts.html">Type Asserts</a></li>
|
65
|
+
<li><a href="utilityAsserts.html">Utility Methods</a></li>
|
66
|
+
<li><a href="stringAssert.html">String Assert</a></li>
|
67
|
+
<li><a href="collectionAssert.html">Collection Assert</a></li>
|
68
|
+
<li><a href="fileAssert.html">File Assert</a></li>
|
69
|
+
</ul>
|
70
|
+
<li><a href="constraintModel.html">Constraint Model</a></li>
|
71
|
+
</ul>
|
72
|
+
<li><a href="attributes.html">Attributes</a></li>
|
73
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
74
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
75
|
+
<li><a href="features.html">Other Features</a></li>
|
76
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
77
|
+
<li><a href="samples.html">Samples</a></li>
|
78
|
+
<li><a href="license.html">License</a></li>
|
79
|
+
</ul>
|
80
|
+
</ul>
|
81
|
+
</div>
|
82
|
+
<!-- End of Submenu -->
|
83
|
+
|
84
|
+
|
85
|
+
<!-- Standard Footer for NUnit.org -->
|
86
|
+
<div id="footer">
|
87
|
+
Copyright © 2008 Charlie Poole. All Rights Reserved.
|
88
|
+
</div>
|
89
|
+
<!-- End of Footer -->
|
90
|
+
|
91
|
+
</body>
|
92
|
+
</html>
|
data/docs/codeFuncs.js
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
window.onload = init;
|
2
|
+
|
3
|
+
var langElements = new Array();
|
4
|
+
|
5
|
+
function init() {
|
6
|
+
var els = document.getElementsByTagName( 'pre' );
|
7
|
+
var elsLen = els.length;
|
8
|
+
var pattern = new RegExp('(^|\\s)(cs|vb|mc|js)(\\s|$)');
|
9
|
+
for (i = 0, j = 0; i < elsLen; i++) {
|
10
|
+
if ( pattern.test(els[i].className) ) {
|
11
|
+
//els[i].style.background = "#fcc";
|
12
|
+
langElements[j] = els[i];
|
13
|
+
j++;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
var lang = getCookie( "lang" );
|
18
|
+
if ( lang == null ) lang = "cs";
|
19
|
+
showLang(lang);
|
20
|
+
}
|
21
|
+
|
22
|
+
function getCookie(name) {
|
23
|
+
var cname = name + "=";
|
24
|
+
var dc = document.cookie;
|
25
|
+
if ( dc.length > 0 ) {
|
26
|
+
begin = dc.indexOf(cname);
|
27
|
+
if ( begin != -1 ) {
|
28
|
+
begin += cname.length;
|
29
|
+
end = dc.indexOf(";",begin);
|
30
|
+
if (end == -1) end = dc.length;
|
31
|
+
return unescape(dc.substring(begin, end) );
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
function setCookie(name,value,expires) {
|
37
|
+
document.cookie = name + "=" + escape(value) + "; path=/" +
|
38
|
+
((expires == null) ? "" : "; expires=" + expires.toGMTString());
|
39
|
+
}
|
40
|
+
|
41
|
+
function showLang(lang) {
|
42
|
+
var pattern = new RegExp('(^|\\s)'+lang+'(\\s|$)');
|
43
|
+
var elsLen = langElements.length;
|
44
|
+
for (i = 0; i < elsLen; i++ )
|
45
|
+
{
|
46
|
+
var el = langElements[i];
|
47
|
+
if ( pattern.test( el.className ) )
|
48
|
+
el.style.display = "";
|
49
|
+
else
|
50
|
+
el.style.display = "none";
|
51
|
+
}
|
52
|
+
setCookie("lang",lang);
|
53
|
+
}
|
54
|
+
|
55
|
+
function Show( id ) {
|
56
|
+
document.getElementById(id).style.display = "";
|
57
|
+
}
|
58
|
+
|
59
|
+
function Hide( id ) {
|
60
|
+
document.getElementById(id).style.display = "none";
|
61
|
+
}
|
62
|
+
|
63
|
+
function ShowCS() {
|
64
|
+
showLang('cs');
|
65
|
+
}
|
66
|
+
|
67
|
+
function ShowVB() {
|
68
|
+
showLang('vb');
|
69
|
+
}
|
70
|
+
|
71
|
+
function ShowMC() {
|
72
|
+
showLang('mc');
|
73
|
+
}
|
74
|
+
|
75
|
+
function ShowJS() {
|
76
|
+
showLang('js');
|
77
|
+
}
|
@@ -0,0 +1,162 @@
|
|
1
|
+
<!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)</h2>
|
28
|
+
<p>The CollectionAssert class provides a number of methods that are useful
|
29
|
+
when examining collections and their contents or for comparing two collections.</p>
|
30
|
+
|
31
|
+
<p>The <b>AreEqual</b> overloads succeed if the two collections contain the same objects,
|
32
|
+
in the same order. <b>AreEquivalent</b> tests whether the collections contain the same
|
33
|
+
objects, without regard to order.</p>
|
34
|
+
|
35
|
+
<p>Beginning with NUnit 2.4.6, these methods may be used on any object that
|
36
|
+
implements IEnumerable. Prior to 2.4.6, only true collections were supported.
|
37
|
+
|
38
|
+
<div class="code" style="width: 38em">
|
39
|
+
<pre>CollectionAssert.AllItemsAreInstancesOfType( IEnumerable collection,
|
40
|
+
Type expectedType );
|
41
|
+
CollectionAssert.AllItemsAreInstancesOfType( IEnumerable collection,
|
42
|
+
Type expectedType, string message );
|
43
|
+
CollectionAssert.AllItemsAreInstancesOfType( IEnumerable collection,
|
44
|
+
Type expectedType, string message, params object[] args );
|
45
|
+
|
46
|
+
CollectionAssert.AllItemsAreNotNull( IEnumerable collection );
|
47
|
+
CollectionAssert.AllItemsAreNotNull( IEnumerable collection,
|
48
|
+
string message );
|
49
|
+
CollectionAssert.AllItemsAreNotNull( IEnumerable collection,
|
50
|
+
string message, params object[] args );
|
51
|
+
|
52
|
+
CollectionAssert.AllItemsAreUnique( IEnumerable collection );
|
53
|
+
CollectionAssert.AllItemsAreUnique( IEnumerable collection,
|
54
|
+
string message );
|
55
|
+
CollectionAssert.AllItemsAreUnique( IEnumerable collection,
|
56
|
+
string message, params object[] args );
|
57
|
+
|
58
|
+
CollectionAssert.AreEqual( IEnumerable expected, IEnumerable actual );
|
59
|
+
CollectionAssert.AreEqual( IEnumerable expected, IEnumerable actual,
|
60
|
+
string message );
|
61
|
+
CollectionAssert.AreEqual( IEnumerable expected, IEnumerable actual
|
62
|
+
string message, params object[] args );
|
63
|
+
|
64
|
+
CollectionAssert.AreEquivalent( IEnumerable expected, IEnumerable actual);
|
65
|
+
CollectionAssert.AreEquivalent( IEnumerable expected, IEnumerable actual,
|
66
|
+
string message );
|
67
|
+
CollectionAssert.AreEquivalent( IEnumerable expected, IEnumerable actual
|
68
|
+
string message, params object[] args );
|
69
|
+
|
70
|
+
CollectionAssert.AreNotEqual( IEnumerable expected, IEnumerable actual );
|
71
|
+
CollectionAssert.AreNotEqual( IEnumerable expected, IEnumerable actual,
|
72
|
+
string message );
|
73
|
+
CollectionAssert.AreNotEqual( IEnumerableon expected, IEnumerable actual
|
74
|
+
string message, params object[] args );
|
75
|
+
|
76
|
+
CollectionAssert.AreNotEquivalent( IEnumerable expected,
|
77
|
+
IEnumerable actual );
|
78
|
+
CollectionAssert.AreNotEquivalent( IEnumerable expected,
|
79
|
+
IEnumerable actual, string message );
|
80
|
+
CollectionAssert.AreNotEquivalent( IEnumerable expected,
|
81
|
+
IEnumerable actual, string message, params object[] args );
|
82
|
+
|
83
|
+
CollectionAssert.Contains( IEnumerable expected, object actual );
|
84
|
+
CollectionAssert.Contains( IEnumerable expected, object actual,
|
85
|
+
string message );
|
86
|
+
CollectionAssert.Contains( IEnumerable expected, object actual
|
87
|
+
string message, params object[] args );
|
88
|
+
|
89
|
+
CollectionAssert.DoesNotContain( IEnumerable expected, object actual );
|
90
|
+
CollectionAssert.DoesNotContain( IEnumerable expected, object actual,
|
91
|
+
string message );
|
92
|
+
CollectionAssert.DoesNotContain( IEnumerable expected, object actual
|
93
|
+
string message, params object[] args );
|
94
|
+
|
95
|
+
CollectionAssert.IsSubsetOf( IEnumerable subset, IEnumerable superset );
|
96
|
+
CollectionAssert.IsSubsetOf( IEnumerable subset, IEnumerable superset,
|
97
|
+
string message );
|
98
|
+
CollectionAssert.IsSubsetOf( IEnumerable subset, IEnumerable superset,
|
99
|
+
string message, params object[] args );
|
100
|
+
|
101
|
+
CollectionAssert.IsNotSubsetOf( IEnumerable subset, IEnumerable superset);
|
102
|
+
CollectionAssert.IsNotSubsetOf( IEnumerable subset, IEnumerable superset,
|
103
|
+
string message );
|
104
|
+
CollectionAssert.IsNotSubsetOf( IEnumerable subset, IEnumerable superset,
|
105
|
+
string message, params object[] args );
|
106
|
+
|
107
|
+
CollectionAssert.IsEmpty( IEnumerable collection );
|
108
|
+
CollectionAssert.IsEmpty( IEnumerable collection, string message );
|
109
|
+
CollectionAssert.IsEmpty( IEnumerable collection, string message,
|
110
|
+
params object[] args );
|
111
|
+
|
112
|
+
CollectionAssert.IsNotEmpty( IEnumerable collection );
|
113
|
+
CollectionAssert.IsNotEmpty( IEnumerable collection, string message );
|
114
|
+
CollectionAssert.IsNotEmpty( IEnumerable collection, string message,
|
115
|
+
params object[] args );</pre>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<!-- Submenu -->
|
121
|
+
<div id="subnav">
|
122
|
+
<ul>
|
123
|
+
<li><a href="index.html">NUnit 2.4.8</a></li>
|
124
|
+
<ul>
|
125
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
126
|
+
<li><a href="assertions.html">Assertions</a></li>
|
127
|
+
<ul>
|
128
|
+
<li><a href="classicModel.html">Classic Model</a></li>
|
129
|
+
<ul>
|
130
|
+
<li><a href="equalityAsserts.html">Equality Asserts</a></li>
|
131
|
+
<li><a href="identityAsserts.html">Identity Asserts</a></li>
|
132
|
+
<li><a href="conditionAsserts.html">Condition Tests</a></li>
|
133
|
+
<li><a href="comparisonAsserts.html">Comparison Asserts</a></li>
|
134
|
+
<li><a href="typeAsserts.html">Type Asserts</a></li>
|
135
|
+
<li><a href="utilityAsserts.html">Utility Methods</a></li>
|
136
|
+
<li><a href="stringAssert.html">String Assert</a></li>
|
137
|
+
<li id="current"><a href="collectionAssert.html">Collection Assert</a></li>
|
138
|
+
<li><a href="fileAssert.html">File Assert</a></li>
|
139
|
+
</ul>
|
140
|
+
<li><a href="constraintModel.html">Constraint Model</a></li>
|
141
|
+
</ul>
|
142
|
+
<li><a href="attributes.html">Attributes</a></li>
|
143
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
144
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
145
|
+
<li><a href="features.html">Other Features</a></li>
|
146
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
147
|
+
<li><a href="samples.html">Samples</a></li>
|
148
|
+
<li><a href="license.html">License</a></li>
|
149
|
+
</ul>
|
150
|
+
</ul>
|
151
|
+
</div>
|
152
|
+
<!-- End of Submenu -->
|
153
|
+
|
154
|
+
|
155
|
+
<!-- Standard Footer for NUnit.org -->
|
156
|
+
<div id="footer">
|
157
|
+
Copyright © 2008 Charlie Poole. All Rights Reserved.
|
158
|
+
</div>
|
159
|
+
<!-- End of Footer -->
|
160
|
+
|
161
|
+
</body>
|
162
|
+
</html>
|
@@ -0,0 +1,130 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
2
|
+
<html>
|
3
|
+
<!-- Standard Head Part -->
|
4
|
+
<head>
|
5
|
+
<title>NUnit - CollectionConstraints</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>Collection Constraints (NUnit 2.4)</h2>
|
28
|
+
|
29
|
+
<p>Collection constraints perform tests that are specific to collections.
|
30
|
+
The following collection constraints are provided.
|
31
|
+
|
32
|
+
<table class="constraints">
|
33
|
+
<tr><th>Syntax Helper</th><th>Constructor</th><th>Operation</th></tr>
|
34
|
+
<tr><td>Is.All...<br>Has.All...</td><td>AllItemsConstraint( Constraint )</td></td><td>applies a constraint to each item in a collection, succeeding only if all of them succeed</td></tr>
|
35
|
+
<tr><td>Has.Some...</td><td>SomeItemsConstraint( Constraint )</td></td><td>applies a constraint to each item in a collection, succeeding if at least one of them succeeds</td></tr>
|
36
|
+
<tr><td>Has.None...</td><td>NoItemConstraint( Constraint )</td></td><td>applies a constraint to each item in a collection, succeeding only if all of them fail</td></tr>
|
37
|
+
<tr><td>Is.Unique</td><td>UniqueItemsConstraint()</td></td><td>tests that a collection contains only unique items</td></tr>
|
38
|
+
<tr><td>Has.Member( object )</td><td>CollectionContainsConstraint( object )</td></td><td>tests that a collection contains an object</td></tr>
|
39
|
+
<tr><td>Is.EquivalentTo( IEnumerable )</td><td>CollectionEquivalentConstraint( ICollection )</td></td><td>tests that two collections are equivalent</td></tr>
|
40
|
+
<tr><td>Is.SubsetOf( IEnumerable )</td><td>CollectionSubsetConstraint( ICollection )</td></td><td>tests that one collection is a subset of another</td></tr>
|
41
|
+
</table>
|
42
|
+
|
43
|
+
<h4>Notes</h4>
|
44
|
+
|
45
|
+
<ol>
|
46
|
+
<li>Two collections are equivalent if they contain the same items, in any order.
|
47
|
+
<li>To compare collections for equality, use Is.EqualTo().
|
48
|
+
<li>Has.Member uses object equality to find an object in a collection. To check
|
49
|
+
for an object equal to an item the collection, use Has.Some.EqualTo().
|
50
|
+
<li>Beginning with NUnit 2.4.2, use of a collection constraint with a non-collection
|
51
|
+
argument causes an error rather than a test failure. This avoids false positives
|
52
|
+
when the collection constraint is negated.
|
53
|
+
<li>Beginning with NUnit 2.4.6, you may use any object implementing IEnumerable
|
54
|
+
in place of a collection.
|
55
|
+
</ol>
|
56
|
+
|
57
|
+
<h4>Examples of Use</h4>
|
58
|
+
|
59
|
+
<div class="code" style="width: 38em"><pre>
|
60
|
+
int[] iarray = new int[] { 1, 2, 3 };
|
61
|
+
string[] sarray = new string[] { "a", "b", "c" };
|
62
|
+
|
63
|
+
Assert.That( iarray, Is.All.Not.Null );
|
64
|
+
Assert.That( sarray, Is.All.InstanceOfType(typeof(string)) );
|
65
|
+
Assert.That( iarray, Is.All.GreaterThan(0) );
|
66
|
+
|
67
|
+
Assert.That( sarray, Is.Unique );
|
68
|
+
|
69
|
+
Assert.That( iarray, List.Contains(3) );
|
70
|
+
Assert.That( sarray, List.Contains("b") );
|
71
|
+
Assert.That( sarray, List.Not.Contains("x") );
|
72
|
+
|
73
|
+
Assert.That( new string[] { "c", "a", "b" }, Is.EquivalentTo( sarray ) );
|
74
|
+
Assert.That( new int[] { 1, 2, 2 }, Is.Not.EquivalentTo( iarray ) );
|
75
|
+
Assert.That( new int[] { 1, 3 }, Is.SubsetOf( iarray ) );
|
76
|
+
|
77
|
+
// Using inheritance
|
78
|
+
Expect( iarray, All.GreaterThan( 0 ) );
|
79
|
+
Expect( sarray, Contains("b") );
|
80
|
+
Expect( new int[] { 1, 3 }, SubsetOf( iarray ) );
|
81
|
+
</pre></div>
|
82
|
+
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<!-- Submenu -->
|
87
|
+
<div id="subnav">
|
88
|
+
<ul>
|
89
|
+
<li><a href="index.html">NUnit 2.4.8</a></li>
|
90
|
+
<ul>
|
91
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
92
|
+
<li><a href="assertions.html">Assertions</a></li>
|
93
|
+
<ul>
|
94
|
+
<li><a href="classicModel.html">Classic Model</a></li>
|
95
|
+
<li><a href="constraintModel.html">Constraint Model</a></li>
|
96
|
+
<ul>
|
97
|
+
<li><a href="equalConstraint.html">Equal Constraint</a></li>
|
98
|
+
<li><a href="sameasConstraint.html">SameAs Constraint</a></li>
|
99
|
+
<li><a href="conditionConstraints.html">Condition Constraints</a></li>
|
100
|
+
<li><a href="comparisonConstraints.html">Comparison Constrants</a></li>
|
101
|
+
<li><a href="typeConstraints.html">Type Constraints</a></li>
|
102
|
+
<li><a href="stringConstraints.html">String Constraints</a></li>
|
103
|
+
<li id="current"><a href="collectionConstraints.html">Collection Constraints</a></li>
|
104
|
+
<li><a href="propertyConstraint.html">Property Constraint</a></li>
|
105
|
+
<li><a href="compoundConstraints.html">Compound Constraints</a></li>
|
106
|
+
<li><a href="customConstraints.html">Custom Constraints</a></li>
|
107
|
+
<li><a href="listMapper.html">List Mapper</a></li>
|
108
|
+
</ul>
|
109
|
+
</ul>
|
110
|
+
<li><a href="attributes.html">Attributes</a></li>
|
111
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
112
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
113
|
+
<li><a href="features.html">Other Features</a></li>
|
114
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
115
|
+
<li><a href="samples.html">Samples</a></li>
|
116
|
+
<li><a href="license.html">License</a></li>
|
117
|
+
</ul>
|
118
|
+
</ul>
|
119
|
+
</div>
|
120
|
+
<!-- End of Submenu -->
|
121
|
+
|
122
|
+
|
123
|
+
<!-- Standard Footer for NUnit.org -->
|
124
|
+
<div id="footer">
|
125
|
+
Copyright © 2008 Charlie Poole. All Rights Reserved.
|
126
|
+
</div>
|
127
|
+
<!-- End of Footer -->
|
128
|
+
|
129
|
+
</body>
|
130
|
+
</html>
|