Closed
Description
Hi!
Maybe I don’t know something, but to my surprise, in the test window (VS), I could not display the parameter names, in xunit they are displayed. This is solved simply enough to enable it by default. I would like to have such an opportunity at least optionally.
public override string GetText(MethodInfo method, object[] arglist)
{
var sb = new StringBuilder();
if (arglist != null)
{
sb.Append('(');
var parameters = method.GetParameters();
for (int i = 0; i < arglist.Length; i++)
{
//sample code, nothing more.
if (i > 0) sb.Append(", ");
var paramName = parameters.Length > i ? parameters[i].Name : "?";
sb.Append(paramName);
sb.Append(": ");
sb.Append(GetDisplayString(arglist[i], Math.Max(1, _maxStringLength - paramName.Length - 3)));
}
sb.Append(')');
}
return sb.ToString();
}
The result is pleasing.
What do you think about it?
(Above is a sample code for adding default functionality)