[Mono-list] assertions in code?

Richard Anthony Hein 935551@ican.net
Thu, 15 Nov 2001 01:29:23 -0500


System.Diagnostics.Debug.Assert()

HTH,

Richard A. Hein

-----Original Message-----
From: mono-list-admin@ximian.com [mailto:mono-list-admin@ximian.com]On
Behalf Of Daniel Weber
Sent: November 14, 2001 11:59 PM
To: mono-list@ximian.com
Subject: [Mono-list] assertions in code?


I'm coding up XmlAttributeCollection and I've been putting statements in
functions like:

public virtual void CopyTo(XmlAttribute [] array, int index)
{
  if (array == null)
    throw new ArgumentNullException("null array argument in CopyTo()");
  ...
}

Is there an equivelant to assert in C#?  Is there some kind of standard for
when I should check, and what I should do if null is passed in?  Some
methods
in the MSDN documentation explicitly call for null arguments to return
certain values, but most of them don't say anything, nor do they list the
ArgumentNullException in the exception section.

Any input?

_______________________________________________
Mono-list maillist  -  Mono-list@ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list