❔ 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
Connor
Connor2y ago
Bogus You have to specify what values you want though
koidestroyer
koidestroyerOP2y ago
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
Accord
Accord2y ago
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.
Oops
Oops2y ago
You should be able to use AutoFixture for this.
Accord
Accord2y ago
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.
Want results from more Discord servers?
Add your server