C#. Assert. Defensive programming

SO

First of all Assert() method is available for Trace and Debug classes.
Debug.Assert() is executing only in Debug mode.
Trace.Assert() is executing in Debug and Release mode.

Here is an example:

 

This entry was posted in C#. Bookmark the permalink.