public void SetUp() { connection = Database.Opener.OpenMemoryConnection(connectionString); db = Database.OpenConnection(connectionString); PrepareDatabase(); }
public void Dispose() { if (IsInitialized) { connection.Destroy(); connection.Dispose(); connection = null; IsInitialized = false; } }
public dynamic DB() { if (!IsInitialized) { Dispose(); connection = Database.Opener.OpenMemoryConnection(connectionString); db = Database.OpenConnection(connectionString); var createTableSql = Properties.Resources.CreateSqliteDML; connection.Open(); var command = connection.CreateCommand(); command.CommandText = createTableSql; command.ExecuteNonQuery(); IsInitialized = true; } return db; }