Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Less brittle tests with SQL Server CE
 

Pages: 1
LLBLGen Pro Runtime Framework
Less brittle tests with SQL Server CE
Page:1/1 

  Print all messages in this thread  
Poster Message
MattWoberts
User



Location:
Lancaster, UK
Joined on:
08-Apr-2004 10:24:31
Posted:
497 posts
# Posted on: 02-Jun-2010 23:25:00.  
Hi,

I am writing a repository class which is returning EntityCollection's, and I want to test my code out with a mocked out repository, so that I don't have any unpleasant brittle dependencies on the database.

The way i do this usually is to mock the repository and in my mocks, return a hand coded entity collection for the tests. However, some of my graphs are quite deep now, and this is getting pretty tedious. So, I was thinking that a nice alternative would be to use a "local" SQL Server Compact Edition database complete with the same tables and some test data, and in my test project set the connection string to this database file.

The LLBLGen gen'd code is fed from a SQL Server 2005 database, so before i spend a lot of time setting up a SQL Server CE "mini" database, I wanted to check if this is going to work, or if it will fail because I need to re-generate the code off the SQL Server CE database using different settings....

Thanks

Matt
Matt  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8133 posts
# Posted on: 03-Jun-2010 04:12:43.  
Hi Matt,

Did you mean SQL CE Desktop, right?
Yes, It should work that way. As a matter of fact LLBLGen Pro (since v2.6) uses the normal SqlServer DQE assembly for query production for CE Desktop, so you don't have to make changes on your assembly reference. You just need to make the change on your connection string and sql compatibility level. Please read this for more information.

Some features wont be available in CE Desktop though (Stored procedures, multiple catalogs, multiple schemas).


David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
MattWoberts
User



Location:
Lancaster, UK
Joined on:
08-Apr-2004 10:24:31
Posted:
497 posts
# Posted on: 03-Jun-2010 13:06:59.  
Ace! I'll give it a go and let you all know how it goes here once done.
Matt  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.