private void Program_Run_DbGen(string pipeName) { using (var consoleOutput = new ConsoleOutput()) { var dbGenOption = new DbGenOptions() { CancellationPipeName = pipeName, DbSessionProviderType = typeof(_DbProvider).FullName }; var args = Parser.Default.FormatCommandLine(dbGenOption).Split(' '); var result = args.RunDbInit(); Assert.AreEqual(ExitCodes.Succeeded, result); var expected = @"Executing DevZest.Data.DbInit.Program.Run... Creating table [SalesLT].[Address]... Creating table [SalesLT].[Customer]... Creating table [SalesLT].[CustomerAddress]... Creating table [SalesLT].[ProductCategory]... Creating table [SalesLT].[ProductModel]... Creating table [SalesLT].[ProductDescription]... Creating table [SalesLT].[ProductModelProductDescription]... Creating table [SalesLT].[Product]... Creating table [SalesLT].[SalesOrderHeader]... Creating table [SalesLT].[SalesOrderDetail]... "; Assert.AreEqual(expected, consoleOutput.GetOuput()); } }
public static int Execute(DbGenOptions options) { return(new DbGenRunner(options.CancellationPipeName).Run(options.DbSessionProviderType, options.DbInitializerType, options.ProjectPath, options.Verbose)); }