public void TestUpdateExtendedPropertiesForView() { // Arrange var databaseFactory = new SqlServerDatabaseFactory { DatabaseImportSettings = new DatabaseImportSettings { ConnectionString = "server=(local);database=Store;integrated security=yes;", ExtendedProperties = { "MS_Description" } } }; // Act var database = databaseFactory.Import(); var view = database.FindView("Sales.OrderSummary"); databaseFactory.DropExtendedPropertyIfExists(view, "MS_Description"); databaseFactory.AddExtendedProperty(view, "MS_Description", "Summary for orders"); databaseFactory.UpdateExtendedProperty(view, "MS_Description", "Summary for orders (Update)"); // Assert }
public void TestUpdateExtendedPropertiesForColumnFromTable() { // Arrange var databaseFactory = new SqlServerDatabaseFactory { DatabaseImportSettings = new DatabaseImportSettings { ConnectionString = "server=(local);database=Store;integrated security=yes;", ExtendedProperties = { "MS_Description" } } }; // Act var database = databaseFactory.Import(); var table = database.FindTable("Production.Product"); databaseFactory.DropExtendedPropertyIfExists(table, table.GetColumn("ProductID"), "MS_Description"); databaseFactory.AddExtendedProperty(table, table.GetColumn("ProductID"), "MS_Description", "ID for product"); databaseFactory.UpdateExtendedProperty(table, table.GetColumn("ProductID"), "MS_Description", "ID for product (Update)"); // Assert }
public void UpdateExtendedPropertiesForTable() { // Arrange var dbFactory = new SqlServerDatabaseFactory { DatabaseImportSettings = new DatabaseImportSettings { ConnectionString = "server=(local);database=OnlineStore;integrated security=yes;", ExtendedProperties = { "MS_Description" } } }; // Act var db = dbFactory.Import(); var table = db.FindTable("Warehouse.Product"); dbFactory.DropExtendedPropertyIfExists(table, "MS_Description"); dbFactory.AddExtendedProperty(table, "MS_Description", "Products catalog"); dbFactory.UpdateExtendedProperty(table, "MS_Description", "Products catalog (Update)"); // Assert }
public void TestAddExtendedPropertiesForColumnFromView() { // Arrange var databaseFactory = new SqlServerDatabaseFactory { DatabaseImportSettings = new DatabaseImportSettings { ConnectionString = "server=(local);database=Store;integrated security=yes;", ExtendedProperties = { "MS_Description" } } }; // Act var database = databaseFactory.Import(); var view = database.FindView("Sales.OrderSummary"); databaseFactory.DropExtendedPropertyIfExists(view, view.GetColumn("CustomerName"), "MS_Description"); databaseFactory.AddExtendedProperty(view, view.GetColumn("CustomerName"), "MS_Description", "Name for customer (CompanyName)"); }
public void TestAddExtendedPropertiesForDatabase() { // Arrange var databaseFactory = new SqlServerDatabaseFactory { DatabaseImportSettings = new DatabaseImportSettings { ConnectionString = "server=(local);database=Store;integrated security=yes;", ExtendedProperties = { "MS_Description" } } }; // Act var database = databaseFactory.Import(); databaseFactory.DropExtendedPropertyIfExists("MS_Description"); databaseFactory.AddExtendedProperty(database, "MS_Description", "Online store"); // Assert }