Closed alexmg closed 1 month ago
@alexmg Thanks for the PR.
There was an issue with the reflection cache that it wasn't handling IDictionary generics well. I pushed an update so IDictionary<,> doesn't go down the ICollection route like you show here.
Pull latest, and see comments, thanks!
Tests look good
I added a try-finally
block to ensure the standard output is always returned.
I ran into a situation with a type that returned a read-only instance through a property exposing a collection interface. Unfortunately, this can be done without declaring a return type that accurately indicates the true read-only nature of the collection.
This PR takes into consideration
IList
orIDictionary
instances that areIsReadyOnly
when populating collections. I also added unit tests to assert that no exceptions are thrown during theGenerate
invocation. Because all exceptions are caught and written to the console when populating members, the only option to prove no exception is being thrown in a unit test, was to ensure nothing was written to standard output in addition to checking the collection remained empty.Props for carrying the torch and creating a viable replacement for AutoBogus. 🙏