Freigeben über


Unit testing databases

Here's a cool tool on CodePlex that Tim pointed me to for anyone who needs to write unit tests on your data-access code:

https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=MassDataHandler

“The MassDataHandler is a framework to assist with Database Unit Testing. The framework makes it very easy to insert test data into a database, which in turn makes it very easy to write database unit tests. The user merely needs to specify their relevant data in a simple XML fragment, and then the framework uses knowledge of the database schema to do all the grunt work and convert that XML data into SQL, from which it populates the database.

The XML fragments that contain the test data are robust and refactorable. You can include expressions like variables substitution and identity lookup, default row templates, and include statements to import sub-templates. Because the framework already knows the database schema, you only need to specify the relevant data, and the framework can auto-populate the rest of the row’s required columns with dummy data.”

 

Version 1.2 was just recently released. This code gets compiled to just a .Net assembly, so you can reference it from MSTest, NUnit, or any other .Net code.

Comments