1
I have a test routine where a certain line of code is not accepted by the coverage.
This is a test to return Defaultvalue since the object calling it is null.
This is the method being tested
public static TResult IfNotNull<TObject, TResult>(this TObject obj,
Func<TObject, TResult> action, TResult defaultValue)
{
if (action == null)
throw new ArgumentNullException(nameof(action));
return obj == null ? defaultValue : action(obj);
}
See that it is marking as 100% tested.
How to solve this problem?