title: Cannot make nunit test exception to work .Using .net 2.0
body: <p>for whatever the reason i cannot seem to get the syntax right.
  How do you make the following test work. I just have a simple method TestThrowexception and would like it to pass
  what Am i doing wrong here?</p>
  
  <pre><code>           [TestFixture]
              public class ExceptionsTests
              {       
                  [Test]
                  public void When_calling_my_method_it_should_throw_an_exception()
                  {
                  //THIS DOES NOT WORK
                      Person person=new Person();
  
                      PersonException ex = Assert.Throws&lt;PersonException&gt;(delegate { person.ThrowPersonException(); },
                                                               Has.Property("Message").EqualTo("Test person Exception throw"));
  
                  }
              }
  
              public class Person
              {
                  public void ThrowException()
                  {
                      throw new Exception("Test Exception thrown");
                  }
                  public void ThrowPersonException()
                  {
                      throw new CustomerException("Test person Exception thrown");
                  }
  
  
                  public void ThrowArgumentException(string myParam)
                  {
                      throw new ArgumentException("Argument Exception", myParam);
                  }
              }
              [Serializable]
              public class PersonException : Exception
              {
  
                  public PersonException()
                  {
                  }
  
                  public PersonException(string message)
                      : base(message)
                  {
                  }
  
                  public PersonException(string message, Exception inner)
                      : base(message, inner)
                  {
                  }
  
                  protected PersonException(
                      SerializationInfo info,
                      StreamingContext context)
                      : base(info, context)
                  {
                  }
              }
          }
  </code></pre>