Ejemplo n.º 1
0
        public void Dispose_WasCommited_ShouldNotRollback()
        {
            var createTable = new CreateTableExpression {
                TableName = "silly"
            };

            createTable.Columns.Add(new Model.ColumnDefinition {
                Name = "one", Type = DbType.Int32
            });
            _processor.Process(createTable);

            // this will close the connection
            _processor.CommitTransaction();
            // and this will reopen it again causing Dispose->RollbackTransaction not to throw
            var tableExists = _processor.TableExists("", createTable.TableName);

            tableExists.ShouldBeTrue();

            // Now dispose (->RollbackTransaction)
            _processor.Dispose();

            _processor = MakeProcessor();

            // Check that the table still exists after dispose
            _processor.TableExists("", createTable.TableName).ShouldBeTrue();
        }