AutoBogus icon indicating copy to clipboard operation
AutoBogus copied to clipboard

Extend GenerateUniqueMany with an EqualityComparer

Open Mosie1 opened this issue 2 years ago • 1 comments

Extend GenerateUniqueMany with an EqualityComparer to allow for case insensitive Dictionary keys.

When creating an inherited dictionary with string keys that are case insensitive, the AutoFaker sometimes tries to add duplicate keys to the dictionary. This is because the string comparison used for the generation of the keys is case sensitive.

To resolve this I added an additional IEqualityComparer parameter to the GenerateUniqueMany method and pass this parameter from the DictionaryGenerator.

Mosie1 avatar Sep 12 '22 15:09 Mosie1

@nickdodd79 Could you have a look please?

Mosie1 avatar Sep 12 '22 20:09 Mosie1