public void ShouldScriptAllSprocs() { IList <DbObjectName> sprocs = engine.GetAllSprocs(connSettings); ScriptingOptions options = new ScriptingOptions(); options.ExportDirectory = exportDir; options.AddSprocsToScript(sprocs); engine.Script(connSettings, options); string dataPath = Path.Combine(exportDir, "Sprocs"); Assert.IsTrue(File.Exists(Path.Combine(dataPath, "dbo.GetCustomers.sql")), "GetCustomers script missing"); Assert.IsTrue(File.Exists(Path.Combine(dataPath, "dbo.GetCustomerAddress.sql")), "GetCustomerAddress script missing"); }
public void ShouldScriptEverythingToSingleScript() { IList <DbObjectName> views = engine.GetAllViews(connSettings); IList <DbObjectName> sprocs = engine.GetAllSprocs(connSettings); IList <DbObjectName> tables = engine.GetAllTables(connSettings); ScriptingOptions options = new ScriptingOptions(); options.ExportDirectory = exportDir; options.AddTablesToScript(tables); options.AddSprocsToScript(sprocs); options.AddViewsToScript(views); options.ScriptData = true; options.ScriptForeignKeys = true; options.ScriptIndexes = true; options.ScriptSchema = true; options.UseMultipleFiles = false; engine.Script(connSettings, options); Assert.IsTrue(File.Exists(Path.Combine(exportDir, "SqlMigration1.sql"))); }