Looking for the data for the DAAB unit tests

Topics: Data Access Application Block
Mar 26, 2007 at 8:27 PM
Now that IBM has provided a .NET 2.0 API (http://www-306.ibm.com/software/data/db2/windows/dotnet.html), I wrote my own DAAB provider for DB2. I know, I know...you EntLib folks have said to just use the Generic Database provider, but it seems to me that a provider calling the DB2 API directly can offer more value.

Anyway, the documentation says that once I'm done with my implementation, I should "use the unit tests that are included in the Data Access Application Block assembly to verify that your provider works." I copied these unit tests to my own test project, refactored appropriately, and am now ready to run them, but I need the data that the tests have been written against. The best thing I could find was a Northwind.mdb file in the UnitTests\Data directory. So, after installing MS Access and then porting the data to SQL Server (haven't even ported the data to DB2 yet) I tried to run some of the SQL Server provider tests and had failures. For instance, the SqlExecuteScalarFixture class tests with the text "Select count(*) from region", but the Northwind.mdb file contains no table named "region". What gives? Where can I get a copy of the actual database used for the DAAB unit tests? Thanks!

Mar 27, 2007 at 1:29 AM
A specific DB2 Database Class is definitely a better idea than using the GenericDatabase Class if you have the time and knowledge to build it. You can add many additional features that may not be in the generic class. I encourage you to perhaps add it to CodePlex where others in the community can help you add features and fix bugs.

For Enterprise Libary 3.0, there is a separate source code installer that installs the unit tests and source code. If you accept the installation defaults, there are instnwnd.sql and CreateNorthWindDb.cmd files in the following directory:

C:\EntLib3Src\App Blocks

I double checked and did see at the very end of the instnwnd.sql file it was creating a Region Table as well as data and some other tables and data. I would use it to create your database and see if that helps.




David Hayden
Microsoft MVP C#