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