Esempio n. 1
0
        public void Visit_with_create_sequence_operation()
        {
            var model     = new DatabaseModel();
            var sequence  = new Sequence("dbo.MySequence");
            var operation = new CreateSequenceOperation(sequence);

            Assert.Equal(0, model.Sequences.Count);

            operation.Accept(new DatabaseModelModifier(), model);

            Assert.Equal(1, model.Sequences.Count);
            Assert.Same(sequence, model.Sequences[0]);
        }
Esempio n. 2
0
        public void Visit_with_create_sequence_operation()
        {
            var model     = new DatabaseModel();
            var sequence  = new Sequence("dbo.MySequence", "bigint", 2, 3);
            var operation = new CreateSequenceOperation(sequence);

            Assert.Equal(0, model.Sequences.Count);

            operation.Accept(new DatabaseModelModifier(), model);

            Assert.Equal(1, model.Sequences.Count);

            Assert.NotSame(sequence, model.Sequences[0]);
            Assert.Equal("dbo.MySequence", model.Sequences[0].Name);
            Assert.Equal("bigint", model.Sequences[0].DataType);
            Assert.Equal(2, model.Sequences[0].StartWith);
            Assert.Equal(3, model.Sequences[0].IncrementBy);
        }