Skip to content

Commit ab8ca7b

Browse files
committed
throw exception on ambiguous match for headers
1 parent 156ddad commit ab8ca7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TestStack.BDDfy/Scanners/StepScanners/Fluent/FluentScanner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private StepTitle CreateTitle(string stepTextTemplate, bool includeInputsInStepT
209209
.ToList();
210210

211211
if (matchingHeaders.Count > 1)
212-
throw new ArgumentException($"Cannot uniquely distinguish parameter name between '{methodInfo.Name}' method's parameter name '{i.ParameterName}' and header's name '{i.Value.Name}'");
212+
throw new AmbiguousMatchException ($"More than one headers for examples, match the parameter '{i.ParameterName}' provided for '{methodInfo.Name}'");
213213

214214
var matchingHeader = matchingHeaders.SingleOrDefault();
215215
if (matchingHeader != null)

0 commit comments

Comments
 (0)