Skip to content

Conversation

felix-v-net
Copy link

Added ArgumentException with a message to let user know that parameter name conflicts with header name in ExampleTable

Added ArgumentException with a message to let user know that parameter name conflicts with header name in ExampleTable
.ToList();

if (matchingHeaders.Count > 1)
throw new ArgumentException($"Cannot uniquely distinguish parameter name between '{methodInfo.Name}' method's parameter name '{i.ParameterName}' and header's name '{i.Value.Name}'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new ArgumentException($"Cannot uniquely distinguish parameter name between '{methodInfo.Name}' method's parameter name '{i.ParameterName}' and header's name '{i.Value.Name}'");
throw new AmbiguousMatchException ($"More than one headers for examples, match the parameter '{i.ParameterName}' provided for '{methodInfo.Name}'");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need System.Reflection namespace. It would be a good idea to add a test for this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants