Migrating from monodoc/class to mcs/docs...
[mono.git] / mcs / nunit20 / Documentation / en / NUnit.Framework / AssertionException.xml
1 <Type Name="AssertionException" FullName="NUnit.Framework.AssertionException">
2   <TypeSignature Language="C#" Maintainer="auto" Value="public class AssertionException : Exception" />
3   <AssemblyInfo>
4     <AssemblyName>nunit.framework</AssemblyName>
5     <AssemblyPublicKey>
6     </AssemblyPublicKey>
7     <AssemblyVersion>2.1.4.0</AssemblyVersion>
8   </AssemblyInfo>
9   <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the &lt;link location="node:gtk-sharp/programming/threads"&gt;Gtk# Thread Programming&lt;/link&gt; for details.</ThreadSafetyStatement>
10   <Base>
11     <BaseTypeName>System.Exception</BaseTypeName>
12   </Base>
13   <Interfaces>
14   </Interfaces>
15   <Docs>
16     <summary>
17     The class AssertionException is thrown if an Assertion failed.
18     </summary>
19     <remarks>
20       <para>
21     You can use this Exception if you want to split up your Test method.
22     </para>
23       <example>
24         <code lang="C#">
25     using NUnit.Framework;
26
27     [TestFixture]
28     public class MyUnitTest : Assertion {
29
30         string foo;
31
32         [SetUp]
33         public void GetReady()
34         {
35                 foo = "Foobar";
36         }
37
38         [Test]
39         public void Foobar()
40         {
41                 try {
42                         Foo (foo);
43                 } catch (AssertionException ex) {
44                         throw new AssertionException ("Foobar failed:  " + ex.Message, ex);
45                 }
46
47                 try {
48                         Bar (foo);
49                 } catch (AssertionException ex) {
50                         throw new AssertionException ("Foobar failed:  " + ex.Message, ex);
51                 }
52         }
53
54         private void Foo (string foobar)
55         {
56                 Assert ("(1) Foo: ", foobar.StartsWith ("Foo"));
57         }
58         
59         private void Bar (string foobar)
60         {
61                 Assert ("(2) Bar: ", foobar.EndsWith ("bar"));
62         }
63     }
64     </code>
65       </example>
66     </remarks>
67   </Docs>
68   <Members>
69     <Member MemberName=".ctor">
70       <MemberSignature Language="C#" Value="public AssertionException (string message);" />
71       <MemberType>Constructor</MemberType>
72       <ReturnValue />
73       <Parameters>
74         <Parameter Name="message" Type="System.String" />
75       </Parameters>
76       <Docs>
77         <param name="message">The message</param>
78         <summary>Creates an AssertionException with a message</summary>
79         <remarks>To be added.</remarks>
80       </Docs>
81       <AssemblyInfo>
82         <AssemblyVersion>2.2.0.0</AssemblyVersion>
83       </AssemblyInfo>
84     </Member>
85     <Member MemberName=".ctor">
86       <MemberSignature Language="C#" Value="protected AssertionException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" />
87       <MemberType>Constructor</MemberType>
88       <ReturnValue />
89       <Parameters>
90         <Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" />
91         <Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" />
92       </Parameters>
93       <Docs>
94         <param name="info">The serialization info.</param>
95         <param name="context">The streaming context</param>
96         <summary>Creates an AssertionException with customized serialization handling.</summary>
97         <remarks>
98         </remarks>
99       </Docs>
100       <AssemblyInfo>
101         <AssemblyVersion>2.2.0.0</AssemblyVersion>
102       </AssemblyInfo>
103     </Member>
104     <Member MemberName=".ctor">
105       <MemberSignature Language="C#" Value="public AssertionException (string message, Exception inner);" />
106       <MemberType>Constructor</MemberType>
107       <ReturnValue />
108       <Parameters>
109         <Parameter Name="message" Type="System.String" />
110         <Parameter Name="inner" Type="System.Exception" />
111       </Parameters>
112       <Docs>
113         <param name="message">The message</param>
114         <param name="inner">An exception which should be wrapped</param>
115         <summary>Creates an AssertionException with a message and wraps it around another exception</summary>
116         <remarks>To be added.</remarks>
117       </Docs>
118       <AssemblyInfo>
119         <AssemblyVersion>2.2.0.0</AssemblyVersion>
120       </AssemblyInfo>
121     </Member>
122   </Members>
123 </Type>