Testing of Queries
Options
Hello,
Currently, I write some powerful complex commands to edit a database. To ensure that everything works fine, I want to write some unit tests or tests again a test database.
Is there a way to run my queries in a test runner or something like that?
Currently, I write some powerful complex commands to edit a database. To ensure that everything works fine, I want to write some unit tests or tests again a test database.
Is there a way to run my queries in a test runner or something like that?
Comments
-
Would Util.Run help? See bottom of this article:
http://www.linqpad.net/lprun.aspx
You can pass in the connection string as a parameter, and then do this:var data = new TypedDataContext (cxString); int count = data.Customers.Count();
This will work as long as the connection string points to a database with the same schema.
-
Yep works fine. Thank you.