Is there any framework for .NET to populate test data?

Take a look at NBuilder. It lets you build test objects with random data, incrementing values, and anything you can probably think of. All through a nice fluent interface.


You might find it relevant. Here is a list of few other frameworks as of today:

Well-known and respected:

  • NBuilder
  • AutoFixture
  • AutoPoco(Discontinued / Deprecated)
  • Bogus - C# port of faker.js with locale support. Used by Elasticsearch (NEST).

Little-known:

  • Hydrator
  • Fabricator

Unfamiliar:

  • TestDataGenerator
  • TestDataFactory (Discontinued)
  • TestData
  • Any-.Net

Yes there is. I found this when watching session #3 of the Summer of NHibernate series by Stephen Bohlen.

His company, Microdesk, has developed a utility that will allow you to save the state of a database on test fixture construction, set the state of the database at the start of every test, and recover the original state of the database on test fixture deconstruction.

Download the utility here: Microdesk.Utility.UnitTest

For a tutorial on how to use it, watch the Summer of NHibernate session #3 video.