File: ExpectedExceptionAttribute.xml

package info (click to toggle)
monodoc 1.9-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 98,436 kB
  • ctags: 5,261
  • sloc: xml: 1,506,218; cs: 40,827; sh: 3,647; perl: 554; makefile: 476
file content (130 lines) | stat: -rw-r--r-- 4,821 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<Type Name="ExpectedExceptionAttribute" FullName="NUnit.Framework.ExpectedExceptionAttribute">
  <TypeSignature Language="C#" Maintainer="auto" Value="public sealed class ExpectedExceptionAttribute : Attribute" />
  <AssemblyInfo>
    <AssemblyName>nunit.framework</AssemblyName>
    <AssemblyPublicKey>
    </AssemblyPublicKey>
    <AssemblyVersion>2.1.4.0</AssemblyVersion>
  </AssemblyInfo>
  <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>
  <Base>
    <BaseTypeName>System.Attribute</BaseTypeName>
  </Base>
  <Interfaces />
  <Attributes>
    <Attribute>
      <AttributeName>System.AttributeUsage(AllowMultiple=False, Inherited=True, ValidOn=System.AttributeTargets.Method)</AttributeName>
    </Attribute>
  </Attributes>
  <Docs>
    <summary>This is the way to specify that the execution of a test will throw an exception.</summary>
    <remarks>
      <para>
    This attribute takes a parameter which is a Type. 
    The runner will execute the test and if it throws the specific exception, then the test passes. 
    If it throws a different exception the test will fail. 
    This is true even if the thrown exception inherits from the expected exception.
    </para>
      <example>
        <code lang="C#">
    using System;
    using NUnit.Framework;
  
    [TestFixture]
    public class SuccessTests
    {
            [Test]
	    [ExpectedException(typeof(InvalidOperationException))]
	    public void ExpectAnException()
	    { 
	            /* ... */ 
            }
    }
    </code>
      </example>
    </remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public ExpectedExceptionAttribute (Type exceptionType);" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters>
        <Parameter Name="exceptionType" Type="System.Type" />
      </Parameters>
      <Docs>
        <param name="exceptionType">The exception which should be thrown to pass the Test</param>
        <summary>Flags a Test that a test should throw a specific exception</summary>
        <remarks>To be added.</remarks>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>2.2.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public ExpectedExceptionAttribute (Type exceptionType, string expectedMessage);" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters>
        <Parameter Name="exceptionType" Type="System.Type" />
        <Parameter Name="expectedMessage" Type="System.String" />
      </Parameters>
      <Docs>
        <param name="exceptionType">a <see cref="T:System.Type" /></param>
        <param name="expectedMessage">a <see cref="T:System.String" /></param>
        <summary>To be added</summary>
        <remarks>To be added</remarks>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>2.2.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="ExceptionType">
      <MemberSignature Language="C#" Value="public Type ExceptionType { set; get; }" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.2.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Type</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>To be added.</summary>
        <value>To be added.</value>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="ExceptionType">
      <MemberSignature Language="C#" Value="public Type ExceptionType { set; get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Type</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="value" Type="System.Type" />
      </Parameters>
      <Docs>
        <summary>The exception which should be thrown to pass the Test</summary>
        <param name="value">An object of type 'Type'</param>
        <returns>An object of type 'Type'</returns>
      </Docs>
      <AssemblyInfo />
    </Member>
    <Member MemberName="ExpectedMessage">
      <MemberSignature Language="C#" Value="public string ExpectedMessage { set; get; }" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>To be added</summary>
        <value>a <see cref="T:System.String" /></value>
        <remarks>To be added</remarks>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>2.2.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
  </Members>
</Type>