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 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
        }
예제 #3
0
        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 TestDropExtendedPropertiesForColumnFromView()
        {
            // 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("HumanResources.EmployeeInfo");

            databaseFactory.DropExtendedPropertyIfExists(view, view.GetColumn("EmployeeName"), "MS_Description");
        }
        public void TestDropExtendedPropertiesForDatabase()
        {
            // 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");

            // 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)");
        }
예제 #7
0
        public void DropExtendedPropertiesForView()
        {
            // 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 view = db.FindView("HumanResources.EmployeeInfo");

            dbFactory.DropExtendedPropertyIfExists(view, "MS_Description");

            // Assert
        }
예제 #8
0
        public void TestDropExtendedPropertiesForColumnFromTable()
        {
            // Arrange
            var databaseFactory = new SqlServerDatabaseFactory
            {
                DatabaseImportSettings = new DatabaseImportSettings
                {
                    ConnectionString   = "server=(local);database=OnlineStore;integrated security=yes;",
                    ExtendedProperties =
                    {
                        "MS_Description"
                    }
                }
            };

            // Act
            var database = databaseFactory.Import();
            var table    = database.FindTable("Warehouse.Product");

            databaseFactory.DropExtendedPropertyIfExists(table, table["ID"], "MS_Description");

            // Assert
        }
예제 #9
0
        public void UpdateExtendedPropertiesForDatabase()
        {
            // Arrange
            var dbFactory = new SqlServerDatabaseFactory
            {
                DatabaseImportSettings = new DatabaseImportSettings
                {
                    ConnectionString   = "server=(local);database=OnlineStore;integrated security=yes;",
                    ExtendedProperties =
                    {
                        "MS_Description"
                    }
                }
            };

            // Act
            var db = dbFactory.Import();

            dbFactory.DropExtendedPropertyIfExists("MS_Description");
            dbFactory.AddExtendedProperty(db, "MS_Description", "Online store");
            dbFactory.UpdateExtendedProperty(db, "MS_Description", "Online store (Update)");

            // Assert
        }