<Type Name="ExpectedExceptionAttribute" FullName="NUnit.Framework.ExpectedExceptionAttribute">
  <TypeSignature Language="C#" Value="public sealed class ExpectedExceptionAttribute : System.Attribute" Maintainer="auto" />
  <AssemblyInfo>
    <AssemblyName>NUnit.Framework</AssemblyName>
    <AssemblyPublicKey>
    </AssemblyPublicKey>
    <AssemblyVersion>2.1.4.0</AssemblyVersion>
    <AssemblyCulture>neutral</AssemblyCulture>
    <Attributes>
      <Attribute>
        <AttributeName>System.CLSCompliantAttribute</AttributeName>
      </Attribute>
    </Attributes>
  </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>
  <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>
  <Base>
    <BaseTypeName>System.Attribute</BaseTypeName>
  </Base>
  <Interfaces />
  <Attributes>
    <Attribute>
      <AttributeName>System.AttributeUsageAttribute</AttributeName>
    </Attribute>
  </Attributes>
  <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>
        <summary>Flags a Test that a test should throw a specific exception</summary>
        <param name="exceptionType">The exception which should be thrown to pass the Test</param>
      </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>
    </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>
        <returns>a <see cref="T:System.String" /></returns>
        <remarks>To be added</remarks>
      </Docs>
    </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>
        <summary>To be added</summary>
        <param name="exceptionType">a <see cref="T:System.Type" /></param>
        <param name="expectedMessage">a <see cref="T:System.String" /></param>
        <returns>a <see cref="T:NUnit.Framework.ExpectedExceptionAttribute" /></returns>
        <remarks>To be added</remarks>
      </Docs>
    </Member>
  </Members>
</Type>