public void GetCommandsNoCurrentSource() { var TempCheckConstraint = new CheckConstraintCommandBuilder(ObjectPool); var Commands = TempCheckConstraint.GetCommands(DesiredSource, null).ToList(); Assert.Single(Commands); Assert.Equal("ALTER TABLE [dbo].[Table A] ADD CONSTRAINT [Constraint A] CHECK (My Definition2)", Commands[0]); }
public void GetCommandsWithCurrentSource() { var TempCheckConstraint = new CheckConstraintCommandBuilder(ObjectPool); var Commands = TempCheckConstraint.GetCommands(DesiredSource, CurrentSource).ToList(); Assert.Equal(2, Commands.Count); Assert.Equal("ALTER TABLE [dbo].[Table A] DROP CONSTRAINT [Constraint A]", Commands[0]); Assert.Equal("ALTER TABLE [dbo].[Table A] ADD CONSTRAINT [Constraint A] CHECK (My Definition2)", Commands[1]); }