Namespace: DeltaEngine.Extensions
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Tests.Extensions.ExceptionExtensionsTests
2 unit tests call DeltaEngine.Extensions.ExceptionExtensions.IsWeak(System.Exception)
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- anyException
- Type: System Exception
Return Value
Type: BooleanUsage 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
Examples
[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