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
UPDATE : I've now pulled out the creation of the database / running of the .sql scripts outside of the unit tests using a batch file to call sqlcmd. And that seems to work fine.