~nunit-core/nunitv2/2.5

« back to all changes in this revision

Viewing changes to doc/testFixture.html

  • Committer: charliepoole
  • Date: 2004-07-18 05:34:53 UTC
  • Revision ID: vcs-imports@canonical.com-20040718053453-ilo808ytjqitic0i
Documentation updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
        <tr>
174
174
          <td class="bodytext">
175
175
            <p><b>Test Fixture (NUnit 2.0)</b><br>
176
 
              This is the attribute that marks a class that contains test methods.
177
 
              This attribute is contained in the <code>NUnit.Framework</code> namespace. In
178
 
              previous versions of NUnit the programmer was required to inherit
179
 
              from a class called <code>TestCase</code>. This is more flexible because it allows
180
 
              a <code>TestFixture</code> attribute to be put on any class.</p>
181
 
            <p><b>Note:</b> There are a few restrictions. The class must have a default
182
 
              constructor. The class must also be a publicly exported type or
183
 
              the program that dynamically builds suites will not see it.</p>
 
176
              This is the attribute that marks a class that contains tests and,
 
177
                          optionally, setup or teardown methods.</p>
 
178
 
 
179
            <p>There are a few restrictions on a class that is 
 
180
                        used as a test fixture.
 
181
                        <ul>
 
182
                          <li>It must be a publicly exported type or NUnit will not see it.</li>
 
183
                          <li>It must have a default constructor or NUnit will not be able 
 
184
                          to construct it.</li>
 
185
                          <li>The constructor should not have any side effects, since NUnit 
 
186
                          may construct the class multiple times in the course of a session.</li>
 
187
                        </ul></p>
 
188
                          
184
189
            <p><b>Example:</b></p>
185
190
            <p>
186
191
                                <script language="JavaScript">
283
288
        <tr>
284
289
          <td class="copyrighttext">
285
290
            <br><hr>
286
 
            Copyright � 2002-2004 James W. Newkirk, Alexei A. Vorontsov. All Rights Reserved.
 
291
            Copyright � 2004 Charlie Poole. All Rights Reserved.
287
292
                  </td>
288
293
        </tr>
289
294
      </table>