E-mail
From a SO question:
namespace ConsoleApplication1{ class Program { static void Main(string[] args) { Console.WriteLine("Hello world"); string value = SendEmail(""); } static string SendEmail(string subject) { #region Parameter assertions Debug.Assert(subject != ""); #endregion return subject; } }}
Put Debug.Assert() everywhere in the code where you want have sanity checks to ensure invariants. When you compile a Release build (i.e., no DEBUG compiler constant), the calls to Debug.Assert() will be removed so they won't affect performance.
You should still throw exceptions before calling Debug.Assert(). The assert just makes sure that everything is as expected while you're still developing.
http://stackoverflow.com/questions/129120/when-should-i-use-debug-assert
Remember Me
a@href@title, strike