ExceptionExtensions IsWeak Method Delta Engine Documentation

Namespace: DeltaEngine.Extensions
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public static bool IsWeak(
	this Exception anyException
)

Return Value

Type: Boolean

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Exception. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

Tests: DeltaEngine.Tests.Extensions.ExceptionExtensionsTests
Examples

2 unit tests call DeltaEngine.Extensions.ExceptionExtensions.IsWeak(System.Exception)
[Test]
public void CheckForWeakException()
{
    Assert.IsFalse(new Exception().IsWeak());
    Assert.IsTrue(new ArgumentNullException().IsWeak());
}
[Test]
public void RethrowWeakExceptionIfNoDebuggerIsAttached()
{
    try
    {
        TryRethrowWeakExceptionIfNoDebuggerIsAttached();
    } // ncrunch: no coverage 
    catch (Exception ex)
    {
        // This will fail if debugger is attached, but that is expected
        Assert.IsTrue(ex.IsWeak());
    }
}
See Also