tags:

views:

54

answers:

1

Hi I wonder if there is any .net library to create "dummy" instances of an object. In my particular scenario im dealing with classes with lots of fields, so manual creation is not practical.

It would not be that hard to code this. But maybe there is something out there. Thanks

+3  A: 

There is. Check out NBuilder.

var products = Builder<Product>.CreateListOfSize(100)
                 .WhereTheFirst(10)
                     .Have(x => x.QuantityInStock = Generate.RandomInt(1, 2000))
                 .List;

And it goes from there. Pretty cool stuff.

womp
Just what i was looking for. Thanks
Hugo Zapata