When I first started learning about how to do database code in .NET and in particular how to test your database code I came across a really useful post on the Code Project.
It basically goes through a tutorial on how to get a base class set up that sets up a brand new SQL Server CE database every test run and populates it from an NHibernate configuration.
This was great, but there were a number of issues that caused it to not work for me (including the fact I decided to use Fluent NHibernate rather than writing a heap of obscure XML). As well as this, there were a couple of fundamental flaws in the way the test worked and it didn’t work with the latest versions of SQL Server CE and NHibernate at the time.
Consequently, I fixed up the code so it worked and I wanted to outline those changes and the final result here in case anyone finds it useful.
Continue reading “Getting up and running with Database testing quickly in .NET”
