The project aims to provide the initialization of data or databases in order to use it on integration tests
The goals of the first stable version are:
- The project must be used over several Database engines
- The project must have a wide range of extension points in order to easily customize.
- The project must have some kind of mechanism to init the schema (database) only when the system detect that is necessary
You must have database created (e.g. 'sakila'). You can use the scripts included on the sakila-db folder or create the database from scratch.
Copy and rename the file "app.config" over "SakilaDataBase" project and replace the connectionstring for the correct one. Be careful the code has a predefined connectionstring name (sakilaConStr) if you want to use another you must change the "SakilaDbOM.ConnectionStringName" property. An example of the connection string could be:
<clear />
<add
name="sakilaConStr"
providerName="MySql.Data.MySqlClient"
connectionString="SERVER=localhost; DATABASE=sakila; UID=root; PASSWORD=toor;Allow User Variables=True;"
/>
If you use MySql you have to keep the clause "Allow User Variables=True;"
If the database is empty you must to run the test that has this piece of code (at the moment the test is called "WhenIUseInitSchemaAllTheTablesWillBeEmpty"):
//Act
_dbInit.InitSchema();