Ejemplo n.º 1
0
        public void ShouldDisableWhenMergedWithRemoveOperation()
        {
            var op       = new AddIndexOperation("schema", "table", "name", new string[0], false, false, new string[0], "where", "on", "filestreamon", new string[0]);
            var removeOp = new RemoveIndexOperation("SCHEMA", "TABLE", "NAME", new[] { "COLUMN" }, true);

            op.Merge(removeOp);
            Assert.That(op.Disabled, Is.True);
            Assert.That(removeOp.Disabled, Is.True);
        }
        public void ShouldSetPropertiesForRemoveIndex()
        {
            const string schemaName = "schemaName";
            const string tableName  = "tableName";
            const string name       = "name";


            var op = new RemoveIndexOperation(schemaName, tableName, name, new[] { "column" }, true);

            Assert.AreEqual(schemaName, op.SchemaName);
            Assert.AreEqual(tableName, op.TableName);
            Assert.That(op.Name, Is.EqualTo(name));
            var expectedQuery = string.Format("drop index [{0}] on [{1}].[{2}]", name, schemaName, tableName);

            Assert.AreEqual(expectedQuery, op.ToQuery());
        }