I have a test routine where a particular line of code is not supported by the coverage.
ThisisatesttoreturntheDefaultValuesincetheobjectthatcallsitisnull.
Thisisthemethodyouaretesting
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 scoring as 100% tested.
How do I solve this problem?