public void ErrorIsReturnedWhenSequenceNameIsEmptyString()
        {
            var expression = new DeleteSequenceExpression { SequenceName = String.Empty };

            var errors = ValidationHelper.CollectErrors(expression);
            errors.ShouldContain(ErrorMessages.SequenceNameCannotBeNullOrEmpty);
        }
        public void ErrorIsNotReturnedWhenSequenceNameIsSet()
        {
            var expression = new DeleteSequenceExpression { SequenceName = "sequence1" };

            var errors = ValidationHelper.CollectErrors(expression);
            Assert.That(errors.Count, Is.EqualTo(0));
        }
        public void CanDeleteSequenceWithoutSchemaName()
        {
            var expression = new DeleteSequenceExpression { SequenceName = "Sequence" };
            var sql = generator.Generate(expression);
            sql.ShouldBe("DROP SEQUENCE Sequence");

            sql = quotedIdentiferGenerator.Generate(expression);
            sql.ShouldBe("DROP SEQUENCE \"Sequence\"");
        }
예제 #4
0
 public override string Generate(DeleteSequenceExpression expression)
 {
     truncator.Truncate(expression);
     return String.Format("DROP SEQUENCE {0}", Quoter.QuoteSequenceName(expression.SequenceName));
 }
        public override string Generate(DeleteSequenceExpression expression)
        {
            var result = new StringBuilder(string.Format("DROP SEQUENCE "));
            result.AppendFormat("{0}.{1}", Quoter.QuoteSchemaName(expression.SchemaName), Quoter.QuoteSequenceName(expression.SequenceName));

            return result.ToString();
        }
 public override string Generate(DeleteSequenceExpression expression)
 {
     return compatabilityMode.HandleCompatabilty("Sequences are not supported in SqlServer2000");
 }
 public void Truncate(DeleteSequenceExpression expression)
 {
     expression.SequenceName = Truncate(expression.SequenceName);
 }
예제 #8
0
 public abstract string Generate(DeleteSequenceExpression expression);
예제 #9
0
 public override string Generate(DeleteSequenceExpression expression)
 {
     return compatabilityMode.HandleCompatabilty("Sequences is not supporteed for MySql");
 }
 public void CanDeleteSequence()
 {
     var expression = new DeleteSequenceExpression { SchemaName = "TestSchema", SequenceName = "Sequence" };
     var sql = generator.Generate(expression);
     sql.ShouldBe("DROP SEQUENCE [TestSchema].[Sequence]");
 }
예제 #11
0
 public virtual void Process(DeleteSequenceExpression expression)
 {
     Process(Generator.Generate(expression));
 }
예제 #12
0
 public IInSchemaSyntax Sequence(string sequenceName)
 {
     var expression = new DeleteSequenceExpression { SequenceName = sequenceName};
     _context.Expressions.Add(expression);
     return new DeleteSequenceExpressionBuilder(expression);
 }
 public override string Generate(DeleteSequenceExpression expression)
 {
     throw new NotImplementedException();
 }
예제 #14
0
 public override string Generate(DeleteSequenceExpression expression)
 {
     return string.Format("{0};", base.Generate(expression));
 }