c# - Using [DebuggerHidden] prevents code coverage -


i have helper class 1 of methods has [debuggerhidden] attribute not show in call stack.

/// <summary> /// encapsulates guard-clause logic conditions allow neat , tidy single line call /// </summary> public static partial class guard {     /// <summary>     /// checks if specified condition true. if      /// system.argumentoutofrangeexception thrown      /// argument name     /// </summary>     /// <example>     /// guard.argumentoutofrange((collection.count == 1), "arg1");     /// </example>     /// <param name="condition">if set <c>true</c> argumentoutofrangeexception thrown.</param>     /// <param name="argumentname">name of argument.</param>     /// <exception cref="argumentoutofrangeexception"></exception>     [debuggerhidden]    //does not appear @ in call stack     public static void argumentoutofrange(boolean condition, [invokerparametername] string argumentname)     {         throw<argumentoutofrangeexception>.if(condition, argumentname);     } } 

this great except need.... except when checking test code coverage including attribute seems exclude method test results. there way around see method has coverage without having keep adding , removing attribute when test coverage?

i using framework 4.0 understand has dedicated attribute stop code coverage why [debuggerhidden] still affect this?


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -