nickdodd79 / AutoBogus

A C# library complementing the Bogus generator by adding auto creation and population capabilities.
MIT License
423 stars 49 forks source link

Extend GenerateUniqueMany with an EqualityComparer #90

Open Mosie1 opened 1 year ago

Mosie1 commented 1 year ago

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 commented 1 year ago

@nickdodd79 Could you have a look please?