source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/IHS BMX Framework/lib/NUnit/NUnit-2.5.10.11092/doc/propertyConstraint.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: 4.1 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 - PropertyConstraint</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>Property Constraints (NUnit 2.4.2)</h2>
28
29<p>Property constraints are used to test for the existence of a named property and
30optionally to test its value. It may also be used as a prefix for other constraints
31to be applied to the property.
32
33<h3>PropertyExistsConstraint</h3>
34
35<h4>Action</h4>
36
37<p>Tests for the existence of a named property on an object.
38
39<h4>Constructor</h4>
40
41<div class="code"><pre>
42PropertyExistsConstraint(string name)
43</pre></div>
44
45<h4>Syntax</h4>
46
47<div class="code"><pre>
48Has.Property( string )
49</pre></div>
50
51<h4>Examples of Use</h4>
52
53<div class="code"><pre>
54Assert.That( someObject, Has.Property( "Version" ) );
55</pre></div>
56
57<h3>PropertyConstraint</h3>
58
59<h4>Action</h4>
60
61<p>Tests for the existence of a named property on an object and causes subsequent
62allows tests to be made on the property value.
63
64<h4>Constructor</h4>
65
66<div class="code"><pre>
67PropertyConstraint(string name)
68</pre></div>
69
70<h4>Syntax</h4>
71
72<div class="code"><pre>
73Has.Property(string)...
74</pre></div>
75
76<h4>Examples of Use</h4>
77
78<div class="code"><pre>
79Assert.That(someObject, Has.Property("Version").EqualTo("2.0"));
80Assert.That(collection, Has.Property("Count").GreaterThan(10));
81</pre></div>
82
83<h3>Special Properties</h3>
84
85<p>Certain common properties are known to NUnit and
86may be tested using the following syntax...
87
88<div class="code"><pre>
89Has.Length...
90Has.Count...
91Has.Message...
92Has.InnerException...
93</pre></div>
94
95
96</div>
97
98<!-- Submenu -->
99<div id="subnav">
100<ul>
101<li><a href="index.html">NUnit 2.5.10</a></li>
102<ul>
103<li><a href="getStarted.html">Getting&nbsp;Started</a></li>
104<li><a href="assertions.html">Assertions</a></li>
105<li><a href="constraintModel.html">Constraints</a></li>
106<ul>
107<li><a href="equalConstraint.html">Equal&nbsp;Constraint</a></li>
108<li><a href="sameasConstraint.html">SameAs&nbsp;Constraint</a></li>
109<li><a href="conditionConstraints.html">Condition&nbsp;Constraints</a></li>
110<li><a href="comparisonConstraints.html">Comparison&nbsp;Constrants</a></li>
111<li><a href="pathConstraints.html">Path&nbsp;Constraints</a></li>
112<li><a href="typeConstraints.html">Type&nbsp;Constraints</a></li>
113<li><a href="stringConstraints.html">String&nbsp;Constraints</a></li>
114<li><a href="collectionConstraints.html">Collection&nbsp;Constraints</a></li>
115<li id="current"><a href="propertyConstraint.html">Property&nbsp;Constraint</a></li>
116<li><a href="throwsConstraint.html">Throws&nbsp;Constraint</a></li>
117<li><a href="compoundConstraints.html">Compound&nbsp;Constraints</a></li>
118<li><a href="delayedConstraint.html">Delayed&nbsp;Constraint</a></li>
119<li><a href="listMapper.html">List&nbsp;Mapper</a></li>
120<li><a href="reusableConstraint.html">Reusable&nbsp;Constraint</a></li>
121</ul>
122<li><a href="attributes.html">Attributes</a></li>
123<li><a href="runningTests.html">Running&nbsp;Tests</a></li>
124<li><a href="extensibility.html">Extensibility</a></li>
125<li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
126<li><a href="samples.html">Samples</a></li>
127<li><a href="license.html">License</a></li>
128</ul>
129</ul>
130</div>
131<!-- End of Submenu -->
132
133
134<!-- Standard Footer for NUnit.org -->
135<div id="footer">
136 Copyright &copy; 2010 Charlie Poole. All Rights Reserved.
137</div>
138<!-- End of Footer -->
139
140</body>
141</html>
Note: See TracBrowser for help on using the repository browser.