using System.IO; using Apache.Ibatis.Common.Data; using Apache.Ibatis.Common.Resources; using Apache.Ibatis.Common.Utilities; namespace Apache.Ibatis.DataMapper.Sqlite.Test.Fixtures { public abstract class ScriptBase { protected string scriptDirectory = Path.Combine(Path.Combine(Path.Combine(Resources.ApplicationBase, ".."), ".."), "Scripts") + Path.DirectorySeparatorChar; /// /// Run a sql batch for the datasource. /// /// The datasource. /// The sql batch public void InitScript(IDataSource datasource, string script) { InitScript(datasource, script, true); } /// /// Run a sql batch for the datasource. /// /// The datasource. /// The sql batch /// parse out the statements in the sql script file. private void InitScript(IDataSource datasource, string script, bool doParse) { ScriptRunner runner = new ScriptRunner(); runner.RunScript(datasource, script, doParse); } } }