views:

124

answers:

2

We are doing some DDD at work and I am trying to find a good utility for generating Domain Objects with random data, or predefined data, and populating dependent objects.

Example Usage:

var user = DDDObjectFactory.CreateUser();
user.Name = "TestUser";

In our world, a user can not exist without a organization, so if there is no organization we need to create on of those too.

For a specific test, i may not care about any property other than the username, so that is the only one that I specify real data for, all others should have random data.

Any help would be greatly appreciated.

+2  A: 

You can take a look at AutoFixture.

Darin Dimitrov
+3  A: 

Or NBuilder

Alex