chType=MessageMatch.Contains )]
public void TestMethod()
{
...</pre></div>

<p>If MatchType is not specified, an exact match is used as before.</p>

<h4>Specifying a Custom Error Message</h4>

<p>With NUnit 2.4, it is possible to specify a custom message to be
displayed if the ExpectedException attribute is not satisfied. This
is done through the UserMessage named parameter...</p>

<div class="code" style="width: 41em">
<pre class="prettyprint">[ExpectedException( typeof( ArgumentException ), UserMessage="C