namespace NUnit.Framework { using System; using System.Diagnostics; using System.Runtime.Serialization; /// /// Thrown when an assertion failed. Here to preserve the inner /// exception and hence its stack trace. /// [Serializable] public class NUnitException : ApplicationException { /// /// Serialization Constructor /// protected NUnitException(SerializationInfo info, StreamingContext context) : base(info,context){} /// /// Standard constructor /// /// The error message that explains /// the reason for the exception public NUnitException(string message) : base (message){} /// /// Standard constructor /// /// The error message that explains /// the reason for the exception /// The exception that caused the /// current exception public NUnitException(string message, Exception inner) : base(message, inner) {} /// /// Indicates that this exception wraps an AssertionFailedError /// exception /// public virtual bool IsAssertionFailure { get { AssertionFailedError inner = this.InnerException as AssertionFailedError; if(inner != null) return true; return false; } } } }