From b5397bee877e26177273a345c078cfbe74181f96 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 7 Oct 2023 23:04:02 +1100 Subject: [PATCH] Update VerifierSettings.cs --- src/Verify/Naming/VerifierSettings.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Verify/Naming/VerifierSettings.cs b/src/Verify/Naming/VerifierSettings.cs index 68c5512b7e..424cac9621 100644 --- a/src/Verify/Naming/VerifierSettings.cs +++ b/src/Verify/Naming/VerifierSettings.cs @@ -56,6 +56,12 @@ static void GetNameForParameter(object? parameter, StringBuilder builder, bool i var type = parameter.GetType(); + if (parameterToNameLookup.TryGetValue(type, out var lookup)) + { + builder.Append(lookup(parameter)); + return; + } + foreach (var (key, value) in parameterToNameLookup) { if (key.IsAssignableFrom(type)) @@ -77,6 +83,7 @@ static void GetNameForParameter(object? parameter, StringBuilder builder, bool i { builder.Append('['); } + foreach (var item in enumerable) { GetNameForParameter(item, builder, false);