nickdodd79 / AutoBogus

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

Unable to generate instance if a property is for an abstract type #104

Open PureKrome opened 1 year ago

PureKrome commented 1 year ago

I have a full repo code showing that AutoBogus cannot create a new instance of something, if that-something has a property which is an abstract type.

I thought the documentation said that it will revert this property to null?

Here's the full code which reproduces this problem: https://dotnetfiddle.net/yDQh82

Is this a bug on my end, or with AutoBogus? Is there a way to "hint" to AutoBogusthat it should SKIP any property decorated with some custom code, which means I can avoid this issue.

soenneker commented 2 months ago

@PureKrome I created some tests around this and confirmed it's working in soenneker.utils.autobogus

PureKrome commented 2 months ago

@soenneker so does this mean a PR is maybe required here to move any of your code fixes into the main codebase, here?

soenneker commented 2 months ago

@PureKrome this repository hasn't been updated in years.

Any changes made in my repo are not being made to port over, as the architecture is incompatible.

PureKrome commented 2 months ago

image