posts - 19 , comments - 8 , trackbacks - 0

Assert

A Generic Assert Class for C#
Overview The following code provides a mechanism for creating asserts which throw a generic exception. My initial motivation was to express in a more concise way common argument and result checking code. For example the following code: public string Read(Stream stream, Encoding encoding, int count) { if (stream == null) throw new ArgumentNullException("stre... "The stream must be created."); if (encoding == null) throw new ArgumentNullException("enco... "The encoding must be specified."); if ......

Posted On Thursday, December 4, 2014 1:25 PM | Comments (0) | Filed Under [ C# Assert Generic ]

Powered by: