/// <summary> /// Generate a SQL to drop a existing view in database /// </summary> /// <param name="dropViewOperation">The operation to produce sql for.</param> public virtual void Generate(DropViewOperation dropViewOperation) { using (var writer = Writer()) { writer.WriteLine("DROP VIEW {0} ", dropViewOperation.ViewName); this.Statement(writer); } }
public void Generate_DropViewOperation_produce_valid_statement() { var operation = new DropViewOperation("ViewName"); var sqlGenerator = new ExtendedSqlServerMigrationSqlGenerator(); var sql = sqlGenerator.Generate(new MigrationOperation[] { operation }, "2008").Join(ss => ss.Sql, Environment.NewLine); Assert.Contains("DROP VIEW ViewName", sql); }
public void Can_get_properties() { var operation = new DropViewOperation("viewName"); Assert.Equal("viewName", operation.ViewName); }