❔ Testing: Is there a library that can automatically populate all properties in an object?
For integration tests I would love a mechanism that would grab an object, automatically populate all (or a subset thereof) properties with random values of the adequate type so I can create them on the database, retrieve the object back from the db and validate all properties.
I know that one can build so with reflection and some work, but I was wondering if such a library already exists.
5 Replies
Bogus
You have to specify what values you want though
I was thinking about combining Automapper and Faker somehow. I don't know if I'll get what I need
Oh, bogus is the name of a faker like library
So that's what I was hoping to fill with Automapper post/pre map hooks. But it feels like a hack
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.You should be able to use AutoFixture for this.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.