It is often desirable to preload the database with test data before running tests. In this recipe, I will show you how to quickly load the in-memory database with data from a SQLite file database.
Complete the previous recipe, Fast testing with SQLite in-memory database.
Create a SQLite file database with identical schema, containing test data. This can be accomplished in a number of ways. Perhaps the easiest is to export an in-memory database using
SQLiteLoader.ExportData from this recipe.
SQLiteLoaderusing the following code:
private static ILog log = LogManager.GetLogger(typeof(SQLiteLoader)); private const string ATTACHED_DB = "asdfgaqwernb"; public void ImportData( ...