Unit Test to Run .sql script to SQL Create Database
- by Lee Englestone
Can anyone point me in the direction of how I could get a NUnit test to run a .sql file to Create / Setup a database.
I know about the the TestFixtureSetUp and TestFixtureTearDown attributes / methods in NUnit.
So I KNOW how to call methods before and after all or each unit tests.
I'm just unsure of how to load and execute the contents of a .sql file agains a SQL Server 2005 database programatically.
Any examples?
This is part of our TDD / CI. We are wanting to create the database before and tear down the database after executing unit tests.
Cheers,
-- Lee