1
<!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
3
<!-- Standard Head Part -->
5
<title>NUnit - IdentityAsserts</title>
6
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
7
<meta http-equiv="Content-Language" content="en-US">
8
<meta name="norton-safeweb-site-verification" content="tb6xj01p4hgo5x-8wscsmq633y11-e6nhk-bnb5d987bseanyp6p0uew-pec8j963qlzj32k5x9h3r2q7wh-vmy8bbhek5lnpp5w4p8hocouuq39e09jrkihdtaeknua" />
9
<link rel="stylesheet" type="text/css" href="nunit.css">
10
<link rel="shortcut icon" href="favicon.ico">
12
<!-- End Standard Head Part -->
16
<!-- Standard Header for NUnit.org -->
18
<a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
1
<!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
3
<!-- Standard Head Part -->
5
<title>NUnit - IdentityAsserts</title>
6
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
7
<meta http-equiv="Content-Language" content="en-US">
8
<meta name="norton-safeweb-site-verification" content="tb6xj01p4hgo5x-8wscsmq633y11-e6nhk-bnb5d987bseanyp6p0uew-pec8j963qlzj32k5x9h3r2q7wh-vmy8bbhek5lnpp5w4p8hocouuq39e09jrkihdtaeknua" />
9
<link rel="stylesheet" type="text/css" href="nunit.css">
10
<link rel="shortcut icon" href="favicon.ico">
12
<!-- End Standard Head Part -->
16
<!-- Standard Header for NUnit.org -->
18
<a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
20
20
<a href="http://www.nunit.org">NUnit</a>
21
21
<a class="active" href="index.html">Documentation</a>
24
<!-- End of Header -->
28
<h2>Identity Asserts</h2>
30
<p><b>Assert.AreSame</b> and <b>Assert.AreNotSame</b> test whether the same objects are
31
referenced by the two arguments.</p>
33
<div class="code" style="width: 36em" >
34
<pre>Assert.AreSame( object expected, object actual );
35
Assert.AreSame( object expected, object actual, string message );
36
Assert.AreSame( object expected, object actual, string message,
37
params object[] parms );
39
Assert.AreNotSame( object expected, object actual );
40
Assert.AreNotSame( object expected, object actual, string message );
41
Assert.AreNotSame( object expected, object actual, string message,
42
params object[] parms );</pre>
45
<p><b>Assert.Contains</b> is used to test whether an object is contained in an array
48
<div class="code" width="36em">
49
<pre>Assert.Contains( object anObject, IList collection );
50
Assert.Contains( object anObject, IList collection,
52
Assert.Contains( object anObject, IList collection,
53
string message, params object[] parms );</pre>
61
<li><a href="index.html">NUnit 2.6</a></li>
63
<li><a href="getStarted.html">Getting Started</a></li>
64
<li><a href="writingTests.html">Writing Tests</a></li>
66
<li><a href="assertions.html">Assertions</a></li>
68
<li><a href="equalityAsserts.html">Equality Asserts</a></li>
69
<li id="current"><a href="identityAsserts.html">Identity Asserts</a></li>
70
<li><a href="conditionAsserts.html">Condition Asserts</a></li>
71
<li><a href="comparisonAsserts.html">Comparison Asserts</a></li>
72
<li><a href="typeAsserts.html">Type Asserts</a></li>
73
<li><a href="exceptionAsserts.html">Exception Asserts</a></li>
74
<li><a href="utilityAsserts.html">Utility Methods</a></li>
75
<li><a href="stringAssert.html">String Assert</a></li>
76
<li><a href="collectionAssert.html">Collection Assert</a></li>
77
<li><a href="fileAssert.html">File Assert</a></li>
78
<li><a href="directoryAssert.html">Directory Assert</a></li>
80
<li><a href="attributes.html">Attributes</a></li>
81
<li><a href="constraintModel.html">Constraints</a></li>
82
<li><a href="testContext.html">Test Context</a></li>
84
<li><a href="runningTests.html">Running Tests</a></li>
85
<li><a href="extensibility.html">Extensibility</a></li>
86
<li><a href="releaseNotes.html">Release Notes</a></li>
87
<li><a href="samples.html">Samples</a></li>
88
<li><a href="license.html">License</a></li>
90
<li><a href="vsTestAdapter.html">NUnit Test Adapter 0.90</a></li>
92
<li><a href="vsTestAdapterLicense.html">License</a></li>
94
<li><a href="&r=2.6.html"></a></li>
95
<li><a href="&r=2.6.html"></a></li>
98
<!-- End of Submenu -->
101
<!-- Standard Footer for NUnit.org -->
103
Copyright © 2012 Charlie Poole. All Rights Reserved.
105
<!-- End of Footer -->
24
<!-- End of Header -->
28
<h2>Identity Asserts</h2>
30
<p><b>Assert.AreSame</b> and <b>Assert.AreNotSame</b> test whether the same objects are
31
referenced by the two arguments.</p>
33
<div class="code" style="width: 36em" >
34
<pre>Assert.AreSame( object expected, object actual );
35
Assert.AreSame( object expected, object actual, string message );
36
Assert.AreSame( object expected, object actual, string message,
37
params object[] parms );
39
Assert.AreNotSame( object expected, object actual );
40
Assert.AreNotSame( object expected, object actual, string message );
41
Assert.AreNotSame( object expected, object actual, string message,
42
params object[] parms );</pre>
45
<p><b>Assert.Contains</b> is used to test whether an object is contained in an array
48
<div class="code" width="36em">
49
<pre>Assert.Contains( object anObject, IList collection );
50
Assert.Contains( object anObject, IList collection,
52
Assert.Contains( object anObject, IList collection,
53
string message, params object[] parms );</pre>
61
<li><a href="index.html">NUnit 2.6.3</a></li>
63
<li><a href="getStarted.html">Getting Started</a></li>
64
<li><a href="writingTests.html">Writing Tests</a></li>
66
<li><a href="assertions.html">Assertions</a></li>
68
<li><a href="classicModel.html">Classic Model</a></li>
70
<li><a href="equalityAsserts.html">Equality Asserts</a></li>
71
<li id="current"><a href="identityAsserts.html">Identity Asserts</a></li>
72
<li><a href="conditionAsserts.html">Condition Asserts</a></li>
73
<li><a href="comparisonAsserts.html">Comparison Asserts</a></li>
74
<li><a href="typeAsserts.html">Type Asserts</a></li>
75
<li><a href="exceptionAsserts.html">Exception Asserts</a></li>
76
<li><a href="utilityAsserts.html">Utility Methods</a></li>
77
<li><a href="stringAssert.html">String Assert</a></li>
78
<li><a href="collectionAssert.html">Collection Assert</a></li>
79
<li><a href="fileAssert.html">File Assert</a></li>
80
<li><a href="directoryAssert.html">Directory Assert</a></li>
82
<li><a href="constraintModel.html">Constraint Model</a></li>
84
<li><a href="attributes.html">Attributes</a></li>
85
<li><a href="testContext.html">Test Context</a></li>
87
<li><a href="runningTests.html">Running Tests</a></li>
88
<li><a href="extensibility.html">Extensibility</a></li>
89
<li><a href="releaseNotes.html">Release Notes</a></li>
90
<li><a href="samples.html">Samples</a></li>
91
<li><a href="license.html">License</a></li>
93
<li><a href="vsTestAdapter.html">NUnit Test Adapter</a></li>
95
<li><a href="vsTestAdapterLicense.html">License</a></li>
96
<li><a href="vsTestAdapterReleaseNotes.html">Release Notes</a></li>
98
<li><a href="&r=2.6.3.html"></a></li>
99
<li><a href="&r=2.6.3.html"></a></li>
102
<!-- End of Submenu -->
105
<!-- Standard Footer for NUnit.org -->
107
Copyright © 2012 Charlie Poole. All Rights Reserved.
109
<!-- End of Footer -->