Ejemplo n.º 1
0
        /// <summary>
        /// Gets the size of the database files information.
        /// </summary>
        private void GetDatabaseFilesInformation()
        {
            try
            {
                DatabaseSchemaAccessLayer databaseInfo     = new DatabaseSchemaAccessLayer(this.ConnectionParams);
                List <DatabaseNameSize>   databaseNameSize = databaseInfo.GetDatabaseNameSize(this.DatabaseName);

                if (databaseNameSize.Count > 0)
                {
                    this.DataGridViewSchema.DataSource = databaseNameSize;
                    int dataGridViewWidth = this.DataGridViewSchema.Width;

                    this.DataGridViewSchema.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                    this.DataGridViewSchema.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                    this.DataGridViewSchema.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
                    this.DataGridViewSchema.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight;

                    this.DataGridViewSchema.Columns[3].DefaultCellStyle.Format = "N0";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public List <DatabaseNameSize> GetDatabaseNameSize(
            [PexAssumeUnderTest] DatabaseSchemaAccessLayer target,
            string database
            )
        {
            List <DatabaseNameSize> result = target.GetDatabaseNameSize(database);

            return(result);
            // TODO: add assertions to method DatabaseSchemaAccessLayerTest.GetDatabaseNameSize(DatabaseSchemaAccessLayer, String)
        }