programisius / morelinq

Automatically exported from code.google.com/p/morelinq
Apache License 2.0
0 stars 0 forks source link

AssertCount still asserts in a release #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, the AssertCount call does not actually act like a traditional 
assert as it is not ignored in a release build. Maybe it should have the 
ConditionalAttribute applied or be renamed to reflect this non-traditional 
behaviour.

Original issue reported on code.google.com by jeffma...@gmail.com on 10 Mar 2009 at 10:15

GoogleCodeExporter commented 8 years ago
We could have VerifyCount for checks that should remain in Release builds and 
AssertCount for the Debug-only builds.

Original comment by jeffma...@gmail.com on 12 Mar 2009 at 1:27

GoogleCodeExporter commented 8 years ago
The name borrows from debug assertion by-design. Usually, no one expect LINQ
operators to go mute, silent or disappear from code between debug and release 
builds
because LINQ operators form part of a result-producing chain and the chain 
should not
be broken. As a result, "assert" here is used to indicate that an exception 
will be
thrown on failure to meet the condition. AssertCount is not designed for 
internal
sanity check but for actual run-time assertion.

Original comment by azizatif on 4 Apr 2009 at 7:22