Here is an example:
FileNotFoundException ex = new FileNotFoundException( "invalid path", "/path/to/nowhere" ); Console.WriteLine( ex ); Assert.DoesNotThrow( delegate { throw ex; }, "file test" );
The Console.Write displays:
System.IO.FileNotFoundException: invalid path File name: '/path/to/nowhere'
The Assert.DoesNotThrow() displays:
file test Unexpected exception: System.IO.FileNotFoundException
I think the details of the exception are important for debugging an application.
Here is an example:
FileNotFound Exception ex = new FileNotFoundExc eption( "invalid path", "/path/to/nowhere" ); WriteLine( ex ); DoesNotThrow( delegate { throw ex; }, "file test" );
Console.
Assert.
The Console.Write displays:
System. IO.FileNotFound Exception: invalid path
File name: '/path/to/nowhere'
The Assert. DoesNotThrow( ) displays:
file test IO.FileNotFound Exception
Unexpected exception: System.
I think the details of the exception are important for debugging an application.