I am use c# and for unit testing and integration testing usually I need to populate fields automatically based on attributes.
Lets say we will test if we can write and get back user data to database.
Is there any framework to populate user with test data automatically and check if two object are have the same values?
Sample code may like this
User user = new User();
AutoPopulator.Populate(user);
user.Save();
xUnit test is the best Unit testing framework for . Net programming languages like C#, VB.Net, and F#. xUnit derives its structure and functionality from SUnit of Smalltalk.
Use Registry Editor (older framework versions) From the Start menu, choose Run, enter regedit, and then select OK. You must have administrative credentials to run regedit. Open the subkey that matches the version you want to check. Use the table in the Detect .NET Framework 1.0 through 4.0 section.
NET. Written by the original inventor of NUnit v2, xUnit.net is the latest technology for unit testing .
You might find it relevant. Here is a list of few other frameworks as of today:
Well-known and respected:
Little-known:
Unfamiliar:
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With