Background
We are slowly updating a very old application (based on "regular" SqlCommandqueries and everything related to it) with some new code. To increase stability and facilitate further development, we have implemented NHibernate in the mix, as well as good programming methods and what not.
So, whenever a new module (and not that the application is actually modular, but allows you to call it) needs a fairly large update, we build all the functionality in the βnewβ world of NHibernate and create a facade for the old code , so it continues to work.
Customization
I create unit tests for facades. To do this, I created a base class from which all unit test classes inherit. This class, onTestInitialize
- creates a database schema using NHibernates "SchemaExport"
- creates an "outdated" schema consisting of all tables that are not yet displayed by Nhibernate but which are necessary for the facades to work
Each TestClass(inheriting from above) has its own DataSet.sql, which runs on TestInitialize, which
- populates mapped Nhibernate tables with specific test data
- fills outdated tables with specific data
- fills in the table
testExecutionswith input and expected output for each test run
TestMethodeach TestClassthen iterates through the lines testExecutions, creates the necessary objects (NHibernate), calls the facade that it is testing, and the Assertsreturned data against what was defined in testExecutions.
Problem
, , , ...
: , , . , ,
", " , , , . , , , .
, TestContext.DataRow NHibernate, , , DataRow , "" Sql .
"" DataSource Nhibernate? DataSource, ? ?
TestMethod testExecution , Data Driven? , , ?