Exemplo n.º 1
0
        public void will_render_sql_WriteSummary()
        {
            var table = _model.FindTable("[Person]");

            _sqlWriter.WriteSummary(_sqlSW, table.Columns[0]);
            Assert.That(_sqlSW.ToString(), Is.EqualTo("ID (int not null)"));

            _sqlSW = new StringWriter();
            _sqlWriter.WriteSummary(_sqlSW, table.Columns[2]);
            Assert.That(_sqlSW.ToString(), Is.EqualTo("Name (nvarchar(100) not null)"));
        }
Exemplo n.º 2
0
        /// <summary>The get summary.</summary>
        /// <param name="column">The column.</param>
        /// <returns>The get summary.</returns>
        private string GetSummary(DbModelColumn column)
        {
            StringWriter stringWriter = new StringWriter();

            if (_sqlWriter == null)
            {
                _sqlWriter = _services.Resolve <ISqlWriter>();
            }

            _sqlWriter.WriteSummary(stringWriter, column);
            return(stringWriter.ToString());
        }